应用程序启动时应用程序类不运行?
问题描述:
我使用的应用程序类,但是当应用程序启动
这里它没有运行是我的代码:应用程序启动时应用程序类不运行?
<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