@Test public void startActivity_withActivityContext_shouldStartActivityWithNoNewFlags() throws IntentNotResolvableException { Intents.startActivity(activityContext, new Intent()); final Intent intent = Robolectric.getShadowApplication().peekNextStartedActivity(); assertThat(Utils.bitMaskContainsFlag(intent.getFlags(), FLAG_ACTIVITY_NEW_TASK)).isFalse(); }
public static void startActivity(@NonNull final Context context, @NonNull final Intent intent) throws IntentNotResolvableException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(intent); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } try { context.startActivity(intent); } catch (ActivityNotFoundException e) { throw new IntentNotResolvableException(e); } }
Intents { public static void startActivity(@NonNull final Context context, @NonNull final Intent intent) throws IntentNotResolvableException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(intent); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } try { context.startActivity(intent); } catch (ActivityNotFoundException e) { throw new IntentNotResolvableException(e); } } }
Intents { public static void startActivity(@NonNull final Context context, @NonNull final Intent intent) throws IntentNotResolvableException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(intent); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } try { context.startActivity(intent); } catch (ActivityNotFoundException e) { throw new IntentNotResolvableException(e); } } private  Intents(); }
Intents { public static void startActivity(@NonNull final Context context, @NonNull final Intent intent) throws IntentNotResolvableException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(intent); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } try { context.startActivity(intent); } catch (ActivityNotFoundException e) { throw new IntentNotResolvableException(e); } } 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 void startActivity(@NonNull final Context context, @NonNull final Intent intent) throws IntentNotResolvableException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(intent); if (!(context instanceof Activity)) { intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } try { context.startActivity(intent); } catch (ActivityNotFoundException e) { throw new IntentNotResolvableException(e); } } 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);  }