GPS Icon not disapearing after closing app

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

GPS Icon not disapearing after closing app

Postby iifuzz » Wed Jun 03, 2009 9:26 pm

Anyone have any ideas why my GPS icon stays up even after i close my app?

How do I get the app to recognize when the back button was pressed to exit the program?
that way i can use

locationManager.removeUpdates(this);
locationManager = null;
finish();
iifuzz
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 21, 2009 6:00 pm

Top

Re: GPS Icon not disapearing after closing app

Postby orux » Thu Jun 04, 2009 9:02 am

You can listen key press

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_BACK){} // back key

if (keyCode == KeyEvent.KEYCODE_HOME){} //home key

return super.onKeyDown(keyCode, event);
}
orux
Freshman
Freshman
 
Posts: 5
Joined: Wed May 13, 2009 3:12 pm

Re: GPS Icon not disapearing after closing app

Postby orux » Thu Jun 04, 2009 9:07 am

But after "locationManager.removeUpdates(myLocationListener);" GPS icon is not removed from StatusBar (almost in emulator).

Is that normal???

Thanks
orux
Freshman
Freshman
 
Posts: 5
Joined: Wed May 13, 2009 3:12 pm

Postby iifuzz » Thu Jun 04, 2009 12:13 pm

maybe it is the finish(); in my quit menu button that is making the GPS icon go away and not the removeupdate..


anyways, i will try the code you posted today . thanks ^_^
iifuzz
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 21, 2009 6:00 pm

Postby iifuzz » Thu Jun 04, 2009 2:29 pm

Hmm, i dont think thats what i needed.

IS there a way to detect when the app was closed... For example, when you push the back button to get out of it?
iifuzz
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 21, 2009 6:00 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests