2013-05-16 42 views

回答

1

您可以保存參考對象的Application落實到靜態變量,並使用靜態方法得到它:

private static Application sInstance; 

@Override 
public void onCreate() 
{ 
    sInstance = this; 
    ACRA.init(this); 
    super.onCreate(); 
} 
public static Application getInstance() 
{ 
    return sInstance; 
} 
+0

THX,不記得靜態的選擇! –