我使用的應用程序類,但是當應用程序啓動
這裏它沒有運行是我的代碼:應用程序啓動時應用程序類不運行?
<application
android:name=".App"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
當我把一個斷點裏面的onCreate()和run
public class App extends Application {
//
private static final String TAG = App.class.getSimpleName();
public static SharedPreferences sPrefs;
private static App sInstance;
public static App getsInstance() {
return sInstance;
}
@Override
public void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
Log.e(TAG,"onCreate()");
sInstance = this;
sPrefs = PreferenceManager.getDefaultSharedPreferences(this);
}
//some methods
}
一個調試它不會停止對它 任何幫助?
但你看到日誌嗎? – Blundell
不,我沒有... – Tefa
應用程序無法運行。如果您試圖向用戶顯示內容,則需要進行一項活動。您可以嘗試將應用程序類設置爲啓動器,但我懷疑它會起作用。 – BlackHatSamurai