|
@@ -189,6 +189,16 @@ public class FileDisplayActivity extends HookActivity
|
|
|
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
|
getSupportActionBar().setHomeButtonEnabled(true);
|
|
|
|
|
|
+ // Init Fragment without UI to retain AsyncTask across configuration changes
|
|
|
+ FragmentManager fm = getSupportFragmentManager();
|
|
|
+ TaskRetainerFragment taskRetainerFragment =
|
|
|
+ (TaskRetainerFragment) fm.findFragmentByTag(TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT);
|
|
|
+ if (taskRetainerFragment == null) {
|
|
|
+ taskRetainerFragment = new TaskRetainerFragment();
|
|
|
+ fm.beginTransaction()
|
|
|
+ .add(taskRetainerFragment, TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT).commit();
|
|
|
+ } // else, Fragment already created and retained across configuration change
|
|
|
+
|
|
|
Log_OC.v(TAG, "onCreate() end");
|
|
|
}
|
|
|
|