0
我有一個類A擴展Application.In A處理uncaughtexceptions。現在的問題是,每當應用程序遇到的任何問題,應用程序凍結和崩潰從應用程序類別退出應用程序
public class A extends Application {
@Override
public void onCreate() {
super.onCreate();
final AppContext context = AppContext.getInstance();
context.setContext(this);
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable e) {
mContext = context.getContext();
e.getCause().getMessage();
AppPreference.getInstance().setCrashReason(e.getMessage());
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity (intent);
System.exit(1);
}
});
}
我尋覓了很多,但都走了進去vain.Thanks提前之前出現黑屏。
這是我在做什麼正確的now.App獲得凍結和黑色的屏幕變成up.After一會兒應用程序沒有響應警報過來。 –
@ashlok malik檢查提供的完整答案鏈接。 – Stanojkovic
我已經提到了上面提到的鏈接,但是應用程序仍然處於凍結狀態,只要遇到任何錯誤就會顯示黑屏 –