|
|
@@ -3,14 +3,9 @@ package com.xzjmyk.pm.activity;
|
|
|
import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
-import android.view.View;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.ImageView;
|
|
|
|
|
|
-import com.afollestad.materialdialogs.MaterialDialog;
|
|
|
-
|
|
|
-import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
|
|
|
-
|
|
|
/**
|
|
|
* Created by RaoMeng on 2016/10/24.
|
|
|
*/
|
|
|
@@ -25,31 +20,31 @@ public class CustomCrashActivity extends Activity {
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_custom_crash);
|
|
|
- mRestartBtn = (Button) findViewById(R.id.restart_btn);
|
|
|
- mCloseBtn = (Button) findViewById(R.id.close_btn);
|
|
|
- mErrorIv = (ImageView) findViewById(R.id.error_image);
|
|
|
- intent = getIntent();
|
|
|
- stackTraceString = CustomActivityOnCrash.getAllErrorDetailsFromIntent(this, intent);
|
|
|
-// if (stackTraceString != null && !CommonUtil.isReleaseVersion()) {
|
|
|
- new MaterialDialog.Builder(this).content(stackTraceString)
|
|
|
- .build().show();
|
|
|
-// }
|
|
|
- final Class<? extends Activity> activityClassFromIntent = CustomActivityOnCrash.getRestartActivityClassFromIntent(intent);
|
|
|
- final CustomActivityOnCrash.EventListener listenerFromIntent = CustomActivityOnCrash.getEventListenerFromIntent(intent);
|
|
|
-
|
|
|
- mRestartBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- Intent intent = new Intent(CustomCrashActivity.this, activityClassFromIntent);
|
|
|
- CustomActivityOnCrash.restartApplicationWithIntent(CustomCrashActivity.this, intent, listenerFromIntent);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mCloseBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- CustomActivityOnCrash.closeApplication(CustomCrashActivity.this, listenerFromIntent);
|
|
|
- }
|
|
|
- });
|
|
|
+// mRestartBtn = (Button) findViewById(R.id.restart_btn);
|
|
|
+// mCloseBtn = (Button) findViewById(R.id.close_btn);
|
|
|
+// mErrorIv = (ImageView) findViewById(R.id.error_image);
|
|
|
+// intent = getIntent();
|
|
|
+// stackTraceString = CustomActivityOnCrash.getAllErrorDetailsFromIntent(this, intent);
|
|
|
+//// if (stackTraceString != null && !CommonUtil.isReleaseVersion()) {
|
|
|
+// new MaterialDialog.Builder(this).content(stackTraceString)
|
|
|
+// .build().show();
|
|
|
+//// }
|
|
|
+// final Class<? extends Activity> activityClassFromIntent = CustomActivityOnCrash.getRestartActivityClassFromIntent(intent);
|
|
|
+// final CustomActivityOnCrash.EventListener listenerFromIntent = CustomActivityOnCrash.getEventListenerFromIntent(intent);
|
|
|
+//
|
|
|
+// mRestartBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// Intent intent = new Intent(CustomCrashActivity.this, activityClassFromIntent);
|
|
|
+// CustomActivityOnCrash.restartApplicationWithIntent(CustomCrashActivity.this, intent, listenerFromIntent);
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// mCloseBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// CustomActivityOnCrash.closeApplication(CustomCrashActivity.this, listenerFromIntent);
|
|
|
+// }
|
|
|
+// });
|
|
|
}
|
|
|
}
|