Getting back from security & location to my application

Posted by sandman42 on Stack Overflow See other posts from Stack Overflow or by sandman42
Published on 2010-04-28T14:01:19Z Indexed on 2010/04/28 14:03 UTC
Read the original article Hit count: 200

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about android

Related posts about activity