@Test public void getStartActivityIntent_withBundle_shouldReturnIntentWithExtras() throws Exception { Context context = new Activity(); Bundle bundle = new Bundle(); bundle.putString("arbitrary key", "even more arbitrary value"); final Intent intent = Intents.getStartActivityIntent(context, MoPubBrowser.class, bundle); assertThat(intent.getComponent().getClassName()).isEqualTo(MoPubBrowser.class.getName()); assertThat(Utils.bitMaskContainsFlag(intent.getFlags(), FLAG_ACTIVITY_NEW_TASK)).isFalse(); assertThat(intent.getExtras()).isEqualTo(bundle); }
public static Intent getStartActivityIntent(@NonNull final Context context, @NonNull final Class clazz, @Nullable final Bundle extras) { final Intent intent = new Intent(context, clazz); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } if (extras != null) { intent.putExtras(extras); } return intent; }
Intents { public static Intent getStartActivityIntent(@NonNull final Context context, @NonNull final Class clazz, @Nullable final Bundle extras) { final Intent intent = new Intent(context, clazz); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } if (extras != null) { intent.putExtras(extras); } return intent; } }
Intents { public static Intent getStartActivityIntent(@NonNull final Context context, @NonNull final Class clazz, @Nullable final Bundle extras) { final Intent intent = new Intent(context, clazz); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } if (extras != null) { intent.putExtras(extras); } return intent; } private  Intents(); }
Intents { public static Intent getStartActivityIntent(@NonNull final Context context, @NonNull final Class clazz, @Nullable final Bundle extras) { final Intent intent = new Intent(context, clazz); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } if (extras != null) { intent.putExtras(extras); } return intent; } private  Intents(); static void startActivity(@NonNull final Context context, @NonNull final Intent intent); static Intent getStartActivityIntent(@NonNull final Context context,
            @NonNull final Class clazz, @Nullable final Bundle extras); static boolean deviceCanHandleIntent(@NonNull final Context context,
            @NonNull final Intent intent); static boolean canHandleApplicationUrl(final Context context, final Uri uri); static boolean canHandleApplicationUrl(final Context context, final Uri uri,
            final boolean logError); static Intent intentForNativeBrowserScheme(@NonNull final Uri uri); static Intent intentForShareTweet(@NonNull final Uri uri); static void showMoPubBrowserForUrl(@NonNull final Context context,
            @NonNull Uri uri); static void launchActionViewIntent(Context context, @NonNull final Uri uri,
            @NonNull final String errorMessage); static void launchIntentForUserClick(@NonNull final Context context,
            @NonNull final Intent intent, @Nullable final String errorMessage); static void launchApplicationUrl(@NonNull final Context context,
            @NonNull final Uri uri); }
Intents { public static Intent getStartActivityIntent(@NonNull final Context context, @NonNull final Class clazz, @Nullable final Bundle extras) { final Intent intent = new Intent(context, clazz); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } if (extras != null) { intent.putExtras(extras); } return intent; } private  Intents(); static void startActivity(@NonNull final Context context, @NonNull final Intent intent); static Intent getStartActivityIntent(@NonNull final Context context,
            @NonNull final Class clazz, @Nullable final Bundle extras); static boolean deviceCanHandleIntent(@NonNull final Context context,
            @NonNull final Intent intent); static boolean canHandleApplicationUrl(final Context context, final Uri uri); static boolean canHandleApplicationUrl(final Context context, final Uri uri,
            final boolean logError); static Intent intentForNativeBrowserScheme(@NonNull final Uri uri); static Intent intentForShareTweet(@NonNull final Uri uri); static void showMoPubBrowserForUrl(@NonNull final Context context,
            @NonNull Uri uri); static void launchActionViewIntent(Context context, @NonNull final Uri uri,
            @NonNull final String errorMessage); static void launchIntentForUserClick(@NonNull final Context context,
            @NonNull final Intent intent, @Nullable final String errorMessage); static void launchApplicationUrl(@NonNull final Context context,
            @NonNull final Uri uri);  }