Android : Stopping GPS On Back Button Press
Mar 17, 2010
My application uses GPS updates while it is running and I would like that to stop when the user back out of the app as I assume it will continue wasting a lot of battery power. I've tried intercepting the back button press but it doesn't seem to work. I'm not sure if this is because it's not executing the code or I'm using the wrong command.
CODE:.....................
View 1 Replies
Sep 1, 2009
Trying to the do as the title describes with the following code, but it doesn't seem to work. It just does nothing once i have altered the keyCode. Do i have to do something to the event?
..............
View 8 Replies
View Related
Feb 28, 2009
In my game, I've got one activity starting another activity via an intent. When the user is finished with the second activity, they quit it using the back button. However, I have a problem: when this happens, the second activity is still running, even if it's quit with the back button.
My second activity will eventually give a "game over" message using a pop up window if there is no user input for a period of time. Problem is, when I back out of the second activity (where the game is happening) the "game over" message still appears eventually. This is how I know the second activity is still running. It even displays a "game over" message if my entire app is quit (on the Android OS).
How do I stop an activity completely when the user presses the back button?
View 3 Replies
View Related
Mar 19, 2010
I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application crash, but when I press home button I go through onPause method and I have no exception, it's weird!
View 1 Replies
View Related
May 12, 2009
Are there api to support go to back Programmatically i.e same effect as the back button of the phone.
View 5 Replies
View Related
Jul 24, 2010
The docs say "The onStart() and onStop() methods can be called multiple times, as the activity alternates between being visible and hidden to the user"When I press the back button an it will go back to the previous activity which totally covers the old one.What is going on here?
View 1 Replies
View Related
Mar 8, 2010
Essentially, what I'd like to do is to be able to press the 'back' button on my Hero to take a picture, rather than pressing the trackball.
View 2 Replies
View Related
Sep 30, 2010
When I press the back button all the way isnt it suppose to close the browser? The web browser still shows as a running app.
View 2 Replies
View Related
Nov 5, 2009
From the moment I received my HTC Hero from orange several weeks ago I noticed the when I press the back arrow button on the bottom right of the phone its clicks and creaks, dont think its the button itself but its the plastic battery case that makes the sound.
Does anyone else have this problem?
View 12 Replies
View Related
Mar 30, 2010
Whenever I am using any app and press the home button, the home screen blacks out for a few secs and it takes around 10 sec to get all the icons back and before I can start using my phone again. I am using a non rooted mytouch 3g.
This problem does not happen if I exit an app by pressing the back button. It becomes very annoying at times.
View 7 Replies
View Related
Aug 3, 2010
So i rooted with Droid Does rom, because i heard its nice and fast and what not. So basically the only problem i have with it is this.
When on a call, the proximity sensor doesnt work, so the screen goes black. And when i press the end call button to turn the screen back on it just ends the call. Is this normal? Or a known issue?
View 10 Replies
View Related
Sep 11, 2010
it just flips out goes up and down and the screen cant be touched untill i press the top button and it goes back to the screen lock, i have it rooted and running 2.2 im not all up on what this does should i just reset to og settings?
View 1 Replies
View Related
Apr 22, 2010
I have this problem, I have some audio I wish to play. And I have two buttons for it, 'Play' and 'Stop'.Problem is, after I press the stop button, and then press the Play button, nothing happens. -The stop button stops the song, but I want the Play button to play the song again (from the start) Here is my code:final MediaPlayer mp = MediaPlayer.create(this, R.raw.megadeth);And then the two public onclicks: For playing)
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
button.setText("Playing!");
try {
mp.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
And for stopping the track
final Button button2 = (Button) findViewById(R.id.cancel);
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mp.stop();
mp.reset();
Can anyone see the problem with this? If so could you please fix it. (For suggest)
View 3 Replies
View Related
Jul 28, 2009
i want to trigger the onKeyDown listener programmatically but don't know which method i should call? Does anyone know?
View 3 Replies
View Related
Jul 15, 2010
This is my first android device and i'm loving it... but one thing that irks me is the use, or lack thereof, of the back button.
As I am navigating menus and options in the Settings, I cannot simply go back one menu using the back key. For example, if I go to Settings->Battery Manager->Battery Profile Options and want to go back to the Settings screen, I cannot.
Pushing the back button does nothing and I can only go back to the Settings menu by going Home, then re-entering.
Another quirk regarding the back button is when reading emails. Using a regular email account such as Hotmail, I cannot simply read an email and go back to the inbox using the button.
It makes navigating the phone very tedious.
View 5 Replies
View Related
Nov 4, 2010
I am trying to catch when the user has pressed the Home button. I thought I could use
protected void onResume()
{
registerReceiver(homeReceiver, new IntentFilter(Intent.CATEGORY_HOME));
}
...
private BroadcastReceiver homeReceiver = new BroadcastReceiver()
{
public void onReceive(Context context, Intent intent)
{
// logic here
}
};
but that doesn't seem to work. I understand that onPause will be called, but my particular app has some logic that I need to handle separately. Short story is based on some info coming in, the app will display new Activities to the user. To prevent Back button issues, as each Activity hits it's onStop it calls finish on itself. However if the user presses the Home button I do not want the Activity to call finish so that when the user presses the app icon on the home screen or via the Recently run apps list, the last Activity is brought back
View 3 Replies
View Related
Sep 16, 2010
I realize the Camera button on the Droid X is not a standard feature across all phones, so, I'm curious how to attach a callback to it. I have a camera application that I wrote and I want the user to be able to snap the picture by pressing that button, but currently it doesn't work that way, so, I'm wondering how to attach my callback to it.
View 1 Replies
View Related
Apr 26, 2010
I'm creating an Android application which uses user captured images as part of a larger process. So far my XML layout has a SurfaceView and Button inside a RelativeLayout. I've managed to get the camera preview to show on the SurfaceView but I'm stuck on how to take a picture and save it when a user presses the button.
View 2 Replies
View Related
Jun 4, 2010
I've created a custom PopupWindow but when I press back button, the window doesn't dissapear.
View 3 Replies
View Related
Aug 3, 2010
I came over to Android from Windows Mobile and hate when typing numbers you have to press an extra button. Is there a way I can have it so I only have to tap one button to type a number?
View 2 Replies
View Related
Apr 1, 2010
how to generate a fake press button event . The button in cause is a options menu button. Please tell me if this is possible, or sugest other references
View 2 Replies
View Related
Jul 27, 2010
How can I capture a long press of the device menu button in my application?I thought of an intent filter, but there's only an action called android.intent.action.SEARCH_LONG_PRESS, but nothing for the MENU button.I found that long press of the menu button actually does different things on different devices,i.e. on Nexus One it will show the soft keyboard, while on Samsung Galaxy S it will pop up the search widget.
View 5 Replies
View Related
Aug 3, 2010
I have an Activity with an EditText, a button and a ListView. The purpose is to type a search screen in the EditText, press the button and have the search results populate this list. This is all working perfectly, but the virtual keyboard is behaving strange. If I click the EditText, I get the virtual keyboard. If I click the "Done" button on the virtual keyboard, it goes away. However, if I click my search button before clicking "Done" on the virtual keyboard, the virtual keyboard stays and I can't get rid of it. Clicking the "Done" button does not close the keyboard. It changes the "Done" button from "Done" to an arrow and remains visible.
View 2 Replies
View Related
Jul 19, 2010
What i'm trying to do is just simply have the button load an image at random. However, the button doesn't seem to be working. When i first load the activity there it works fine and there is a random image....But when i press the button it's not loading another like i need it to. Any idea what i have wrong here? It looks fine to me...
View 1 Replies
View Related
Sep 9, 2010
How do i set the sound as ringtone with long press on the button?
View 1 Replies
View Related
Dec 29, 2009
I am using ViewFlipper for my application. I trying to make it.when user pressed on escape (back) button, it would be back to parent Layout.
View 3 Replies
View Related
Nov 24, 2010
i have an app that haves a lot of activitys, all created with ONACTIVITYRESULT.which method is called when i press back key? i need to know it because i have to override/implement code on it
View 2 Replies
View Related
Jul 15, 2010
I have a homescreen widget with an imagebutton. I have the button working with a pending intent, but I can't seem to figure out how to change the button image when it is pressed. I tried using a selector and it works in my widget test activity, but not in the remoteview. How could I implement this functionality in the home screen widget?
View 2 Replies
View Related
Aug 6, 2010
I am trying to capture the camera button press event and get the image in my app. I have a broadcast receiver in my manifest with intent filter having action but when the camera button is pressed in emulator, the CameraClickBroadcastReceiver.onReceiver() method is not invoked. In this method i am starting an activity which is the home activity of my app.
View 2 Replies
View Related
Aug 4, 2010
I need to generate/trigger a long key press event of a button in Android.Searched on net but not able to find any answers.
View 2 Replies
View Related