fragment/src/androidTest/java/androidx/fragment/app/LoaderTest.java
@Test
    public void startWhenReused() throws Throwable {
        LoaderActivity activity = mActivityRule.getActivity();

        assertEquals("Loaded!", activity.textView.getText().toString());

        activity = FragmentActivityUtils.recreateActivity(mActivityRule, activity);

        FragmentTestUtil.waitForExecution(mActivityRule);

        // After orientation change, the text should still be loaded properly
        assertEquals("Loaded!", activity.textView.getText().toString());
    }
/**
     * When a LoaderManager is reused, it should notify in onResume
     */
When a LoaderManager is reused, it should notify in onResume
When a LoaderManager is reused it should notify in onResume
@Test
    public void startWhenReused() throws Throwable {
        LoaderActivity activity = mActivityRule.getActivity();
        assertEquals("Loaded!", activity.textView.getText().toString());
        activity = FragmentActivityUtils.recreateActivity(mActivityRule, activity);
        FragmentTestUtil.waitForExecution(mActivityRule);
        assertEquals("Loaded!", activity.textView.getText().toString());
    }
@ Test public void startWhenReused ( ) throws Throwable { LoaderActivity activity = mActivityRule . getActivity ( ) ; assertEquals ( "Loaded!" , activity . textView . getText ( ) . toString ( ) ) ; activity = FragmentActivityUtils . recreateActivity ( mActivityRule , activity ) ; FragmentTestUtil . waitForExecution ( mActivityRule ) ; assertEquals ( "Loaded!" , activity . textView . getText ( ) . toString ( ) ) ; }
When a LoaderManager is reused, it should notify in onResume
When a LoaderManager is reused it should notify in onResume
// After orientation change, the text should still be loaded properly