List of usage examples for android.app Fragment startActivityForResult
public void startActivityForResult(Intent intent, int requestCode, Bundle options)
From source file:com.github.piasy.safelyandroid.activity.StartActivityDelegate.java
/** * start activity for result from {@link android.app.Fragment} * * @param fragment fragment we start from * @param intent intent to start//from ww w. j a va2 s . c o m * @param requestCode request code * @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 startActivityForResultSafely(@NonNull android.app.Fragment fragment, @NonNull Intent intent, int requestCode, Bundle options) { if (isIntentSafe(fragment.getActivity().getPackageManager(), intent)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { fragment.startActivityForResult(intent, requestCode, options); } else { fragment.startActivityForResult(intent, requestCode); } return true; } return false; }