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
2
votes
1 answer

How to call the override pause method dynamically from Libgdx?

I create a Libgdx game and I want to know if it is possible to call the override pause method lifecycle with Libgdx? Here is my pause method lifecycle in my class: public class MyGdxGame extends ApplicationAdapter { @Override public void…
Wingjam
  • 742
  • 8
  • 17
2
votes
1 answer

Why is unity OnApplicationPause called twice on android?

I have a simple game object (the main UI object) with OnApplicationPause that prints out the Pause status (true/false) in the debug log. When I run it on android, and press the Home Button to leave the app, I see that the OnApplicationPause() is…
Sagi Mann
  • 2,967
  • 6
  • 39
  • 72
2
votes
1 answer

cordova : pause event doesn't fire when receiving a phone call on iphone

I created an android & iOS application with cordova and ionic. I added a listener to the pause event and it fires when another application interrupts mine, for example when I receive a call via skype or when I tap the home button on a iOS…
Sergio Morstabilini
  • 2,035
  • 21
  • 28
2
votes
1 answer

How to stop all sounds in activity?

I have a lot of Mediaplayer sounds in my application acitvity and i have button to stop all sounds that are playing but its taking a lot of space and i want to know the code how to stop all the mediplayer sounds at same time not like this: …
lalilei
  • 51
  • 1
  • 7
2
votes
0 answers

Why does android.os.binderproxy call onPause in my Application?

I have an Android Game, which runs nearly fine. The Game runs with OpenGL ES 2.0 on my Samsung Galaxy Note III (Android 5.0). Some of my testers have HTC devices and they also notice this problem. The OpengGL-Context gets lost sometimes and…
lolxdfly
  • 381
  • 1
  • 3
  • 13
2
votes
1 answer

Prevent EGLContext to be destroyed when going to background

My Android (OpenGL ES 2.0) game needs to be paused when user is minimizing it, without destroying what is already drawn on screen. Originally it used NativeActivity and pure C++, but it looks like it is not possible there. I have rewritten it and it…
rafalczuj
  • 51
  • 1
  • 5
2
votes
2 answers

ViewPager Fragments getting destroyed while app is in background?

I can't for the life of me figure out why sometimes my Fragments become uncontrollable after my app has been launched, paused, and then resumed. I hold references to my Fragments like this: public class MainActivity ... { public static…
2
votes
3 answers

Android saving an ArrayList onPause and onSaveInstanceState

I have an ArrayList filled with some custom POJO's that I'd like to persist when the user switches screen orientation (onSaveInstanceState) and when e.g. the user hits the back button (onPause). As far as I know, the SharedPreferences can only hold…
Marcus
  • 6,697
  • 11
  • 46
  • 89
2
votes
2 answers

How to onResume properly

I've created a simple app that has two buttons that will play and stop a song. Everything is working as it should. However I want it to pause the song when the app goes onPause and Resume playing the song when the app is up again. I have…
Azad
  • 112
  • 6
2
votes
0 answers

How to force resume an Activity paused from stack by name

i'm using a Service to call my Activity by name as follows: Intent i = new Intent(); i.setComponent(new ComponentName("com.packagename", "com.packagename.activities.Intro")); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.putExtra("fromservice",…
Billyjoker
  • 729
  • 1
  • 10
  • 31
2
votes
1 answer

onResume() called twice in a row after onCreate() > onPause()

I've run into a weird occurrence with regards to my child activity's life-cycle methods. If I launch and close the activity enough times, there eventually comes a point where for some reason, upon launching, onPause gets called immediately after…
Drazen Bjelovuk
  • 5,201
  • 5
  • 37
  • 64
2
votes
5 answers

onPause onResume alternative?

I've got a bit of a dilemma and not quite sure how to solve it. Here's the scenario... I have a multi activity application which plays music from the time it starts to the time the application exits. However, if I use onPause / onResume to detect…
user3318682
2
votes
3 answers

OnPaused not triggered

I've created a dialog but according to the activity workflow it should trigger the onpause but it doesn't. What is going wrong? Android Activity Flow : http://developer.android.com/training/basics/activity-lifecycle/pausing.html @Override …
VRC
  • 745
  • 7
  • 16
2
votes
2 answers

add pause on hover in jquery

i cant seem to add a pause on mouse hover to this slide show code , any help will be greatly appreciated