Index: webrtc/examples/androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java |
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java |
index 18f5dc50c7a38fe1aa0d5dea8fc6d9c4bd3d1c3c..33a4382665e184464b0b99e0aeb9a81290d672fe 100644 |
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java |
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java |
@@ -29,8 +29,7 @@ import java.io.StringWriter; |
* Thread.setDefaultUncaughtExceptionHandler() rather than |
* Thread.setUncaughtExceptionHandler(), to apply to background threads as well. |
*/ |
-public class UnhandledExceptionHandler |
- implements Thread.UncaughtExceptionHandler { |
+public class UnhandledExceptionHandler implements Thread.UncaughtExceptionHandler { |
private static final String TAG = "AppRTCMobileActivity"; |
private final Activity activity; |
@@ -40,31 +39,30 @@ public class UnhandledExceptionHandler |
public void uncaughtException(Thread unusedThread, final Throwable e) { |
activity.runOnUiThread(new Runnable() { |
- @Override public void run() { |
- String title = "Fatal error: " + getTopLevelCauseMessage(e); |
- String msg = getRecursiveStackTrace(e); |
- TextView errorView = new TextView(activity); |
- errorView.setText(msg); |
- errorView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 8); |
- ScrollView scrollingContainer = new ScrollView(activity); |
- scrollingContainer.addView(errorView); |
- Log.e(TAG, title + "\n\n" + msg); |
- DialogInterface.OnClickListener listener = |
- new DialogInterface.OnClickListener() { |
- @Override public void onClick( |
- DialogInterface dialog, int which) { |
- dialog.dismiss(); |
- System.exit(1); |
- } |
- }; |
- AlertDialog.Builder builder = |
- new AlertDialog.Builder(activity); |
- builder |
- .setTitle(title) |
- .setView(scrollingContainer) |
- .setPositiveButton("Exit", listener).show(); |
- } |
- }); |
+ @Override |
+ public void run() { |
+ String title = "Fatal error: " + getTopLevelCauseMessage(e); |
+ String msg = getRecursiveStackTrace(e); |
+ TextView errorView = new TextView(activity); |
+ errorView.setText(msg); |
+ errorView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 8); |
+ ScrollView scrollingContainer = new ScrollView(activity); |
+ scrollingContainer.addView(errorView); |
+ Log.e(TAG, title + "\n\n" + msg); |
+ DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { |
+ @Override |
+ public void onClick(DialogInterface dialog, int which) { |
+ dialog.dismiss(); |
+ System.exit(1); |
+ } |
+ }; |
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity); |
+ builder.setTitle(title) |
+ .setView(scrollingContainer) |
+ .setPositiveButton("Exit", listener) |
+ .show(); |
+ } |
+ }); |
} |
// Returns the Message attached to the original Cause of |t|. |