Questions tagged [onpause]

onPause is an Activity life-cycle event generated by the Android OS when an Activity is no longer the top-most one in the stack.

onPause is an Activity life-cycle event generated by the Android OS when an Activity is no longer the top-most one in the stack.

More can be read about this at the Android Developer Site.

462 questions
0
votes
1 answer

How can watch my position when I close my App with Phonegap and jquerymobile

I am using phonegap, jquerymobile the googlemap API to get my current position and to watch my position. For this, when I lunch my map page, my position is shown with a marker and the marker move when I move. Even if it works excpeted when I close…
pierrot10
  • 129
  • 4
  • 13
0
votes
2 answers

Flashlight doesn't turn off when I press back button

I have created a flashlight application...Everything is working fine...except that whenever the flashlight is on and i press the back button...it remains on...and doesn't stop...What to do?..I have used the onpause method but it doesn't seem to…
renupok92
  • 98
  • 1
  • 12
0
votes
1 answer

App launched via widget is closed via phone's back button which is taking to the app's activity which is launched via shortcut

I have an issue with the closing and restarting of my application. I have a widget on homescreen and also I created a shortcut for the app on homescreen. I am entering the app via shortcut and closing it in Activity B by pressing phone's home…
Lavanya
  • 3,903
  • 6
  • 31
  • 57
0
votes
2 answers

Activity not closing properly

I am calling one activity on click of status bar notification which is having a Complete button. on click of btn. i have folllowing code - public void completeTask(){ taskDBAdapter.deleteReminder(rowId); taskDBAdapter.close(); …
RayKaushik
  • 301
  • 5
  • 17
0
votes
1 answer

Pausing or exiting an android game

I'm developing an Android game with all the typical stuff it envolves: the game loop, renderer, panel, ... The problem is that when I exit the game, it always crashes... I think it's because I don't stop correctly the game loop and it continues.…
Frion3L
  • 1,502
  • 4
  • 24
  • 34
0
votes
1 answer

Android destroy bitmaps on pause

I have a game that uses 4 bitmaps. I was just wondering if I should destroy these bitmaps onpause of the game and then recreate them, or leave them as is?
Dave
  • 407
  • 4
  • 17
0
votes
3 answers

Android - Resume application from background programmatically

i need to resume my app as soon as the application goes in background. I don't like my solution cause has a few bugs and is not too performant, this is what i try: @Override protected void onPause() { super.onPause(); Intent intent…
Jayyrus
  • 12,961
  • 41
  • 132
  • 214
0
votes
1 answer

Does onPause get called when the device suddenly turns off

I have a doubt. Suppose we have an android application running and the devices goes for Auto Power OFF eg.- if the battery is pulled out. In this case the device will suddenly switch off and the application will be killed. So does onPause/ onStop…
Ankit
  • 4,426
  • 7
  • 45
  • 62
0
votes
1 answer

Android: Avoid phone restart when clicking home button

I'm programming an app, and I have to solve this problem... Being in any of the activities, when clicking the home button the phone restarts, and I don't want that to happen. I know that clicking the home button brings the app to the background, and…
acm46
  • 9
  • 2
0
votes
1 answer

Can I resume from the same place where my application left calculating while going on pause?

My application is processing data (which involves lot's of calculation, creation of arrays, clearing of those arrays) is it possible to resume from the place it left the calculation when the application resumes ? While the calculation is going on I…
Sumit
  • 103
  • 1
  • 10
0
votes
1 answer

Android App Crashes onPause() -- Logic Works in One Project Fails in Another

I before I started the game I'm currently working on, I built the following logic to handle pausing. Everything works perfectly in there, or so I thought. In the test app that logic still works, which means I broke it somewhere else along the…
Nathan Tornquist
  • 6,468
  • 10
  • 47
  • 72
0
votes
2 answers

Save state for onPause and onResume

I'm even not sure I've written the title correctly, because this is the first time I feel I have to cope with this methods. In onCreate(), I make a notification with default sound printing a string. Then, I check to see if I get another String. If…
azizbekian
  • 60,783
  • 13
  • 169
  • 249
0
votes
1 answer

My onResume() throws a NullPointerException

I am taking accelerometer readings to catch users shaking the phone. When a user shakes the phone, I want to design it to do something. It works fine, but I put in an onPause() method because I don't need the accelerometer detecting any shaking…
FeralShadow
  • 259
  • 1
  • 4
  • 14
0
votes
1 answer

Avoid an Android app enter in onPause() state

I'm programming an Android app that use arToolkit for AR Tags analyse (obtaining the device position using AR tags). The main activity extends to andARActivity who extends to Activity, so I can't make it a Service. I'm trying to make the AR app…
ZanattMan
  • 746
  • 1
  • 7
  • 26
0
votes
1 answer

Why does receiving an Intent calls onPause()

According to Android's Activity lifecyle, method Activity.onPause() is called only if another activity calls into the foreground. My application has only one activity which is itself set with android:launchMode="singleTask". According to the…
David Andreoletti
  • 4,485
  • 4
  • 29
  • 51