Load data in onResume instead of onCreate
This commit is contained in:
parent
a7c8438b15
commit
68494fd022
|
@ -119,8 +119,6 @@ public class MainActivity extends ActionBarActivity {
|
|||
navList.setAdapter(navAdapter);
|
||||
navList.setOnItemClickListener(navListClickListener);
|
||||
|
||||
loadData();
|
||||
|
||||
}
|
||||
|
||||
public ActionBar getMainActivtyActionBar() {
|
||||
|
@ -272,6 +270,8 @@ public class MainActivity extends ActionBarActivity {
|
|||
} else if (feeds != null && intent.hasExtra(EXTRA_NAV_INDEX) && intent.hasExtra(EXTRA_NAV_TYPE)) {
|
||||
handleNavIntent();
|
||||
}
|
||||
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -342,6 +342,7 @@ public class MainActivity extends ActionBarActivity {
|
|||
};
|
||||
|
||||
private void loadData() {
|
||||
cancelLoadTask();
|
||||
loadTask = new AsyncTask<Void, Void, List<Feed>>() {
|
||||
@Override
|
||||
protected List<Feed> doInBackground(Void... params) {
|
||||
|
|
|
@ -96,8 +96,6 @@ public class ItemlistFragment extends ListFragment {
|
|||
Bundle args = getArguments();
|
||||
if (args == null) throw new IllegalArgumentException("args invalid");
|
||||
feedID = args.getLong(ARGUMENT_FEED_ID);
|
||||
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -124,6 +122,7 @@ public class ItemlistFragment extends ListFragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
updateProgressBarVisibility();
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,13 +72,12 @@ public class NewEpisodesFragment extends Fragment {
|
|||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,7 +52,11 @@ public class PlaybackHistoryFragment extends ListFragment {
|
|||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,11 @@ public class QueueFragment extends Fragment {
|
|||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
startItemLoader();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue