Put in progressBar

This commit is contained in:
misaochan 2016-09-06 18:37:42 +12:00
parent f0843ca4f6
commit 53b26a567f

View file

@ -81,7 +81,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
progressBar.setVisibility(View.VISIBLE);
mLatestLocation = ((NearbyActivity) getActivity()).getmLatestLocation();
nearbyAsyncTask = new NearbyAsyncTask();
nearbyAsyncTask = new NearbyAsyncTask(this);
nearbyAsyncTask.execute();
Log.d(TAG, "Adapter set to ListView");
@ -89,13 +89,13 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
@Override
public void onTaskStarted() {
progressDialog = ProgressDialog.show(CopyOfMainActivity.this, "Loading", "Please wait a moment!");
progressBar.setVisibility(View.VISIBLE);
}
@Override
public void onTaskFinished(List<Place> result) {
if (progressDialog != null) {
progressDialog.dismiss();
if (progressBar != null) {
progressBar.setVisibility(View.GONE);
}
}