@Test public void getReturnActivity() { Class<? extends Activity> returnActivity; returnActivity = ErrorActivity.getReturnActivity(MainActivity.class); assertEquals(MainActivity.class, returnActivity); returnActivity = ErrorActivity.getReturnActivity(RouterActivity.class); assertEquals(RouterActivity.class, returnActivity); returnActivity = ErrorActivity.getReturnActivity(null); assertNull(returnActivity); returnActivity = ErrorActivity.getReturnActivity(Integer.class); assertEquals(MainActivity.class, returnActivity); returnActivity = ErrorActivity.getReturnActivity(VideoDetailFragment.class); assertEquals(MainActivity.class, returnActivity); }
@Nullable static Class<? extends Activity> getReturnActivity(final Class<?> returnActivity) { Class<? extends Activity> checkedReturnActivity = null; if (returnActivity != null) { if (Activity.class.isAssignableFrom(returnActivity)) { checkedReturnActivity = returnActivity.asSubclass(Activity.class); } else { checkedReturnActivity = MainActivity.class; } } return checkedReturnActivity; }
ErrorActivity extends AppCompatActivity { @Nullable static Class<? extends Activity> getReturnActivity(final Class<?> returnActivity) { Class<? extends Activity> checkedReturnActivity = null; if (returnActivity != null) { if (Activity.class.isAssignableFrom(returnActivity)) { checkedReturnActivity = returnActivity.asSubclass(Activity.class); } else { checkedReturnActivity = MainActivity.class; } } return checkedReturnActivity; } }
ErrorActivity extends AppCompatActivity { @Nullable static Class<? extends Activity> getReturnActivity(final Class<?> returnActivity) { Class<? extends Activity> checkedReturnActivity = null; if (returnActivity != null) { if (Activity.class.isAssignableFrom(returnActivity)) { checkedReturnActivity = returnActivity.asSubclass(Activity.class); } else { checkedReturnActivity = MainActivity.class; } } return checkedReturnActivity; }  }
ErrorActivity extends AppCompatActivity { @Nullable static Class<? extends Activity> getReturnActivity(final Class<?> returnActivity) { Class<? extends Activity> checkedReturnActivity = null; if (returnActivity != null) { if (Activity.class.isAssignableFrom(returnActivity)) { checkedReturnActivity = returnActivity.asSubclass(Activity.class); } else { checkedReturnActivity = MainActivity.class; } } return checkedReturnActivity; }  static void reportUiError(final AppCompatActivity activity, final Throwable el); static void reportError(final Context context, final List<Throwable> el,
                                   final Class returnActivity, final View rootView,
                                   final ErrorInfo errorInfo); static void reportError(final Context context, final Throwable e,
                                   final Class returnActivity, final View rootView,
                                   final ErrorInfo errorInfo); static void reportError(final Handler handler, final Context context,
                                   final Throwable e, final Class returnActivity,
                                   final View rootView, final ErrorInfo errorInfo); static void reportError(final Handler handler, final Context context,
                                   final List<Throwable> el, final Class returnActivity,
                                   final View rootView, final ErrorInfo errorInfo); static void reportError(final Context context, final CrashReportData report,
                                   final ErrorInfo errorInfo); @Override boolean onCreateOptionsMenu(final Menu menu); @Override boolean onOptionsItemSelected(final MenuItem item); @Override void onBackPressed(); String getCurrentTimeStamp(); }
ErrorActivity extends AppCompatActivity { @Nullable static Class<? extends Activity> getReturnActivity(final Class<?> returnActivity) { Class<? extends Activity> checkedReturnActivity = null; if (returnActivity != null) { if (Activity.class.isAssignableFrom(returnActivity)) { checkedReturnActivity = returnActivity.asSubclass(Activity.class); } else { checkedReturnActivity = MainActivity.class; } } return checkedReturnActivity; }  static void reportUiError(final AppCompatActivity activity, final Throwable el); static void reportError(final Context context, final List<Throwable> el,
                                   final Class returnActivity, final View rootView,
                                   final ErrorInfo errorInfo); static void reportError(final Context context, final Throwable e,
                                   final Class returnActivity, final View rootView,
                                   final ErrorInfo errorInfo); static void reportError(final Handler handler, final Context context,
                                   final Throwable e, final Class returnActivity,
                                   final View rootView, final ErrorInfo errorInfo); static void reportError(final Handler handler, final Context context,
                                   final List<Throwable> el, final Class returnActivity,
                                   final View rootView, final ErrorInfo errorInfo); static void reportError(final Context context, final CrashReportData report,
                                   final ErrorInfo errorInfo); @Override boolean onCreateOptionsMenu(final Menu menu); @Override boolean onOptionsItemSelected(final MenuItem item); @Override void onBackPressed(); String getCurrentTimeStamp(); static final String TAG; static final String ERROR_INFO; static final String ERROR_LIST; static final String ERROR_EMAIL_ADDRESS; static final String ERROR_EMAIL_SUBJECT; static final String ERROR_GITHUB_ISSUE_URL; }