List of usage examples for android.app Fragment startActivity
public void startActivity(Intent intent, Bundle options)
From source file:com.github.piasy.safelyandroid.activity.StartActivityDelegate.java
/** * start activity from {@link android.app.Fragment} * * @param fragment fragment we start from * @param intent intent to start/*from w w w . j a v a2 s . c om*/ * @param options options used to start activity * @return {@code true} if we start it safely, {@code false} if it's unsafe so we didn't start * it */ public static boolean startActivitySafely(@NonNull android.app.Fragment fragment, @NonNull Intent intent, Bundle options) { if (isIntentSafe(fragment.getActivity().getPackageManager(), intent)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { fragment.startActivity(intent, options); } else { fragment.startActivity(intent); } return true; } return false; }