Getting back from security & location to my application
- by sandman42
Hi,
I have an application that allows the user to enable GPS.
In order to do it, first in the main activity I do:
lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
if (!lm.isProviderEnabled(LocationManager.GPS_PROVIDER)){
showGpsOptions();
}
showGpsOptions() is:
private void showGpsOptions()
{
Intent gpsOptionsIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivityForResult(gpsOptionsIntent, BACK_FROM_GPS_ACT);
}
and finally I override main activity onActivityResult in this way:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == BACK_FROM_GPS_ACT){
;
}
super.onActivityResult(requestCode, resultCode, data);
}
Problem: the page show up and works, but when I press back I get back to home screen.
Question: how can I get back to my application?
Thanks a lot