Add comments

This commit is contained in:
misaochan 2016-09-06 19:13:11 +12:00
parent 7a511535ab
commit ea8759acdf

View file

@ -62,6 +62,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
@Override @Override
public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState) {
//Check that this is the first time view is created, to avoid double list when screen orientation changed
if(savedInstanceState == null) { if(savedInstanceState == null) {
mLatestLocation = ((NearbyActivity) getActivity()).getmLatestLocation(); mLatestLocation = ((NearbyActivity) getActivity()).getmLatestLocation();
listview = (ListView) getView().findViewById(R.id.listview); listview = (ListView) getView().findViewById(R.id.listview);
@ -73,9 +74,8 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
progressBar.setVisibility(View.GONE); progressBar.setVisibility(View.GONE);
} }
// If we are returning here from a screen orientation // If we are returning here from a screen orientation and the AsyncTask is still working,
// and the AsyncTask is still working, re-create and display the // re-create and display the progress dialog.
// progress dialog.
if (isTaskRunning) { if (isTaskRunning) {
progressBar.setVisibility(View.VISIBLE); progressBar.setVisibility(View.VISIBLE);
} }