mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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();
|
||||
} else {
|
||||
//If permission not granted, display notification that Nearby Places cannot be displayed
|
||||
/**
|
||||
/**
|
||||
int duration = Toast.LENGTH_LONG;
|
||||
Toast toast = Toast.makeText(this, R.string.no_location_permission, duration);
|
||||
toast.show();*/
|
||||
|
||||
toast.show();
|
||||
*/
|
||||
//TODO: Open a fragment saying permissions not granted instead
|
||||
if (nearbyAsyncTask != null) {
|
||||
nearbyAsyncTask.cancel(true);
|
||||
}
|
||||
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
||||
Fragment fragment = new NoPermissionsFragment();
|
||||
fragment.setArguments(bundle);
|
||||
fragmentTransaction.replace(R.id.container, fragment);
|
||||
Fragment noPermissionsFragment = new NoPermissionsFragment();
|
||||
fragmentTransaction.replace(R.id.container, noPermissionsFragment);
|
||||
fragmentTransaction.addToBackStack(null);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue