mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Cancel AsyncTask and add backstack
This commit is contained in:
parent
0beac41e4b
commit
c8a0142c3e
1 changed files with 9 additions and 6 deletions
|
|
@ -121,16 +121,19 @@ public class NearbyActivity extends NavigationBaseActivity {
|
||||||
startLookingForNearby();
|
startLookingForNearby();
|
||||||
} else {
|
} else {
|
||||||
//If permission not granted, display notification that Nearby Places cannot be displayed
|
//If permission not granted, display notification that Nearby Places cannot be displayed
|
||||||
/**
|
/**
|
||||||
int duration = Toast.LENGTH_LONG;
|
int duration = Toast.LENGTH_LONG;
|
||||||
Toast toast = Toast.makeText(this, R.string.no_location_permission, duration);
|
Toast toast = Toast.makeText(this, R.string.no_location_permission, duration);
|
||||||
toast.show();*/
|
toast.show();
|
||||||
|
*/
|
||||||
//TODO: Open a fragment saying permissions not granted instead
|
//TODO: Open a fragment saying permissions not granted instead
|
||||||
|
if (nearbyAsyncTask != null) {
|
||||||
|
nearbyAsyncTask.cancel(true);
|
||||||
|
}
|
||||||
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
||||||
Fragment fragment = new NoPermissionsFragment();
|
Fragment noPermissionsFragment = new NoPermissionsFragment();
|
||||||
fragment.setArguments(bundle);
|
fragmentTransaction.replace(R.id.container, noPermissionsFragment);
|
||||||
fragmentTransaction.replace(R.id.container, fragment);
|
fragmentTransaction.addToBackStack(null);
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue