fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
public void startActivityFromFragment(Fragment fragment, Intent intent,
            int requestCode, @Nullable Bundle options) {
        mStartedActivityFromFragment = true;
        try {
            if (requestCode == -1) {
                ActivityCompat.startActivityForResult(this, intent, -1, options);
                return;
            }
            checkForValidRequestCode(requestCode);
            int requestIndex = allocateRequestIndex(fragment);
            ActivityCompat.startActivityForResult(
                    this, intent, ((requestIndex + 1) << 16) + (requestCode & 0xffff), options);
        } finally {
            mStartedActivityFromFragment = false;
        }
    }
/**
     * Called by Fragment.startActivityForResult() to implement its behavior.
     */
Called by Fragment.startActivityForResult() to implement its behavior.
Called by Fragment . startActivityForResult () to implement its behavior .
public void startActivityFromFragment(Fragment fragment, Intent intent,
            int requestCode, @Nullable Bundle options) {
        mStartedActivityFromFragment = true;
        try {
            if (requestCode == -1) {
                ActivityCompat.startActivityForResult(this, intent, -1, options);
                return;
            }
            checkForValidRequestCode(requestCode);
            int requestIndex = allocateRequestIndex(fragment);
            ActivityCompat.startActivityForResult(
                    this, intent, ((requestIndex + 1) << 16) + (requestCode & 0xffff), options);
        } finally {
            mStartedActivityFromFragment = false;
        }
    }
public void startActivityFromFragment ( Fragment fragment , Intent intent , int requestCode , @ Nullable Bundle options ) { mStartedActivityFromFragment = true ; try { if ( requestCode == - 1 ) { ActivityCompat . startActivityForResult ( this , intent , - 1 , options ) ; return ; } checkForValidRequestCode ( requestCode ) ; int requestIndex = allocateRequestIndex ( fragment ) ; ActivityCompat . startActivityForResult ( this , intent , ( ( requestIndex + 1 ) << 16 ) + ( requestCode & 0xffff ) , options ) ; } finally { mStartedActivityFromFragment = false ; } }
Called by Fragment.startActivityForResult() to implement its behavior.
Called by Fragment . startActivityForResult () to implement its behavior .