As shown in below code, I want to run my function after the exit of App info Activity
(ACTION_APPLICATION_DETAILS_SETTINGS) using Intent
(app info). But mylocation()
is running along with the opened activity. How to accomplish this?
@Override
public void onRequestPermissionsResult(int requestCode,String[] permissions,int[] grantResults) {
switch (requestCode){
case MY_PERMISSION_FINE_LOCATION:{
if (grantResults.length>0&&grantResults[0]==PackageManager.PERMISSION_GRANTED){
my_location();
}
else
{
Toast.makeText(getActivity(),"Location permission required for fetching your current location Permission>Enable location",Toast.LENGTH_LONG).show();
//redirect to app info
startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:com.example.anonymous.trackerplus")));
my_location();
}
}
}
}