I am having a problem in my Activity, which can take the control to the android mobile GPS settings to have user to switch on/off the GPS, But I am unable to retrun back to my activity. when I press back button, It is directly going to Home of the mobile, not coming back my Activity from where I send signal to settings. can anyone tell me the solution for this.
if(!lm.isProviderEnabled(LocationManager.GPS_PROVIDER )) {
startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS), 1);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.e("","OnActivity Result...");
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == GPS_LOC) {
switch (requestCode) {
case GPS_LOC:
//super.onCreate(inst);
super.onResume();
//super.finish();
break;
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…