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
4
votes
4 answers

onCreate() called while Activity is stopped (but not destroyed). Only after installation

I'm working on an app that targets Api 19, and that is basically a Processing sketch. The problem I'm facing is that the first time my app is run, right after installing it, it works well until the user sends it to the background. Then, if they…
Kajuna
  • 449
  • 5
  • 20
4
votes
0 answers

App restarts instead of resuming when relaunching from app icon after home button is pressed in signed apk

I have an activity in which a form is to be filled by the user.In this activity I am saving data in onPause method and show it back when activity resumes.This works perfectly when i test it in debug mode but when i run signed apk after pressing home…
Manishika
  • 5,478
  • 2
  • 22
  • 28
4
votes
4 answers

Call finish() inside onPause() but not when orientation changes

I have an app that needs to call finish when someone exits its main activity (so i do not want it to be paused), even by pressing home activity has to be finished, to handle this currently i simply call finish() in my onPause() method, since…
JohnUopini
  • 960
  • 9
  • 24
3
votes
3 answers

Application-level onPause

I know that Android doesn't have an Application-level onPause the way an Activity has an onPause, but it looks like I need a similar functionality. I asked a (dumb) question awhile ago…
3
votes
2 answers

Issues with GLSurface in onPause()/ onResume()

I'm having issues with my GLSurfaceView. My main activity has a TabLayout. I put a GLSurfaceView inside a tab like this: renderer = new GLRendererX(Interface.this); cube3d = new GLSurfaceView(Interface.this); …
awaelchli
  • 796
  • 7
  • 23
3
votes
6 answers

New Preferences not loading when back button is pressed

I have this preferences class (below) that saves two ListPreferences, but if the ListPreferences are changed and the back button is pressed, the changes don't take affect unless the application is restarted. Did I miss something? Have been looking…
Chris
  • 85
  • 15
3
votes
2 answers

android WebView stop Flash plugin onPause

I have a WebView that contains a html file that contains a Flash plugin (a video). When the user presses play on the Flash plugin, the video plays fine. However when the user closes the app or moves to a new Activity, the Flash is still playing in…
Iain
  • 105
  • 1
  • 5
3
votes
0 answers

onPause not fired when home button is pressed

I have an Android AppCompatActivity that fails to fire onPause event when the Home button is pressed. According to the Android documentation: The system calls this method as the first indication that the user is leaving your activity (though it…
Roy Hinkley
  • 10,111
  • 21
  • 80
  • 120
3
votes
0 answers

Non static inner class BroadcastReceiver not trigged

I have a BroadcastReceiver inside an Activity to change some views (when it's visible) from a service. I can't make it static(and declare it in manifest) because I access views from activity inside onReceive(), so I register/unregister it inside my…
Choletski
  • 7,074
  • 6
  • 43
  • 64
3
votes
4 answers

Android - set activity result on activity closed

To start activity for result: Intent intent = new Intent(MainActivity.this, DetailsActivity.class); startActivityForResult(intent,EVENT_DETAILS_REQUEST); In my DetailsActivity, to set result and extras, that can be used in main activity: @Override …
user1209216
  • 7,404
  • 12
  • 60
  • 123
3
votes
1 answer

How to differentiate between different causes that an Activity's onPause() is called?

I need to figure out why my Activity's onPause/onStop is called, specifically, whether another Activity (especially from another app) has replaced it, or not. I can think of a few reasons why my Activity may be paused/stopped, as well as a few…
user1118764
  • 9,255
  • 18
  • 61
  • 113
3
votes
0 answers

In what scenarios are onPause and onResume() inconsistent?

I know that in Android onPause() and onResume() can be inconsistent sometimes. (For example, if the user is pulling down the notifications thing from the top of the screen onPause() will not be called even though the activity is partially…
Foobar
  • 7,458
  • 16
  • 81
  • 161
3
votes
2 answers

how to detect app is now foreground after minimizing the app?

by using onResume() i can check if an activity is foreground or not. My problem is this onResume() is fire each time even if i come from another activity to this activity. So my main problem is ,if i minimizing the app by home button I want execute…
user4527757
3
votes
0 answers

Android How to detect application awake from background

May i know how to detect when apps is awake from the background?? the flow is: 1) The application is open 2) User tap home button to go out and using other apps(without exit) 3) User tap recent apps button and choose back current application 4)…
enzo
  • 309
  • 3
  • 15
3
votes
0 answers

Game thread pause/resume android

Greetings, I am developing a game and i want to enable user to continue my game after he minimizes the app and resumes it, but i have run into a wall, and not sure what to do. I have a pause/resume button that works…
Pavle37
  • 571
  • 9
  • 24