fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR1)
    @Test
    public void fragmentActivityFinishEarly() throws Throwable {
        Intent intent = new Intent(mActivityRule.getActivity(), FragmentTestActivity.class);
        intent.putExtra("finishEarly", true);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        FragmentTestActivity activity = (FragmentTestActivity)
                InstrumentationRegistry.getInstrumentation().startActivitySync(intent);

        assertTrue(activity.onDestroyLatch.await(1000, TimeUnit.MILLISECONDS));
    }
/**
     * FragmentActivity should not raise the state of a Fragment while it is being destroyed.
     */
FragmentActivity should not raise the state of a Fragment while it is being destroyed.
FragmentActivity should not raise the state of a Fragment while it is being destroyed .
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR1)
    @Test
    public void fragmentActivityFinishEarly() throws Throwable {
        Intent intent = new Intent(mActivityRule.getActivity(), FragmentTestActivity.class);
        intent.putExtra("finishEarly", true);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        FragmentTestActivity activity = (FragmentTestActivity)
                InstrumentationRegistry.getInstrumentation().startActivitySync(intent);
        assertTrue(activity.onDestroyLatch.await(1000, TimeUnit.MILLISECONDS));
    }
@ SdkSuppress ( minSdkVersion = Build . VERSION_CODES . JELLY_BEAN_MR1 ) @ Test public void fragmentActivityFinishEarly ( ) throws Throwable { Intent intent = new Intent ( mActivityRule . getActivity ( ) , FragmentTestActivity . class ) ; intent . putExtra ( "finishEarly" , true ) ; intent . setFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; FragmentTestActivity activity = ( FragmentTestActivity ) InstrumentationRegistry . getInstrumentation ( ) . startActivitySync ( intent ) ; assertTrue ( activity . onDestroyLatch . await ( 1000 , TimeUnit . MILLISECONDS ) ) ; }
FragmentActivity should not raise the state of a Fragment while it is being destroyed.
FragmentActivity should not raise the state of a Fragment while it is being destroyed .