onpause

onPause / onRestore with savedInstanceState

◇◆丶佛笑我妖孽 提交于 2019-12-03 14:08:52
问题 I'm pretty new to android development and I need some help saving the state of an activity. What is the correct way to save the instance from onPause and restoring it from onRestore since obviously Android isn't sending the savedInstanceState Bundle as it does with onCreate or onSaveInstanceState for example. Or is there a better way to save other than using the savedInstanceState bundle? Does this make sense? [edit] Ok, i think i know what my real problem is... But first, I think what I was

onPause / onRestore with savedInstanceState

匆匆过客 提交于 2019-12-03 04:10:56
I'm pretty new to android development and I need some help saving the state of an activity. What is the correct way to save the instance from onPause and restoring it from onRestore since obviously Android isn't sending the savedInstanceState Bundle as it does with onCreate or onSaveInstanceState for example. Or is there a better way to save other than using the savedInstanceState bundle? Does this make sense? [edit] Ok, i think i know what my real problem is... But first, I think what I was looking for was to use SharedPreferences instead of savedInstanceState. So, doing more debug log

Android - Remove Google Maps Fragment onPause and add back onResume

ε祈祈猫儿з 提交于 2019-12-02 09:33:26
问题 I need to remove Google map fragment on Activity onPause event and add it back onResume event. How can i do this ? <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/mapContainer" tools:context=".MainActivity" > <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match

Android - Remove Google Maps Fragment onPause and add back onResume

白昼怎懂夜的黑 提交于 2019-12-02 05:30:17
I need to remove Google map fragment on Activity onPause event and add it back onResume event. How can i do this ? <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/mapContainer" tools:context=".MainActivity" > <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> <

android WebView stop Flash plugin onPause

吃可爱长大的小学妹 提交于 2019-12-01 09:03:07
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 the background. Going back to the view appears to create a new thread with the Flash plugin running on it. How can we stop the Flash plugin running onPause? Thanks I ran into the same issue. The following worked for me: @Override protected void onDestroy() { super.onDestroy(); final WebView webview = (WebView)findViewById(R.id.webPlayer); // Calling

Android: “Application level” Pause and Resume [closed]

只愿长相守 提交于 2019-11-30 11:36:30
I've been trying to get Application Level Pause and Resume similar to an activity's onPause and onResume. I know there's no API that has this functionality. I try to follow this post: http://curioustechizen.blogspot.com/2012/12/android-application-level-pause-and.html But I've had no luck so far. Has anyone been able to achieve this? What paradigm did you use? Let me know if you need me to paste some code into this question. Thanks for the help Another solution to the problem would be to just keep track of the count of onStart() and onStop() calls from every activity. Example: First, create a

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

半腔热情 提交于 2019-11-30 10:17:13
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 click on the app icon again, onCreate() is called but the activity is not destroyed or restarted. Some variables change and that produces strange behaviours. This happens ONLY the first time the app is used. After force closing it, this behaviour won't happen ever again (as far as I've tested). And this does not happen when launching the app from

Android: “Application level” Pause and Resume [closed]

匆匆过客 提交于 2019-11-29 17:15:29
问题 I've been trying to get Application Level Pause and Resume similar to an activity's onPause and onResume. I know there's no API that has this functionality. I try to follow this post: http://curioustechizen.blogspot.com/2012/12/android-application-level-pause-and.html But I've had no luck so far. Has anyone been able to achieve this? What paradigm did you use? Let me know if you need me to paste some code into this question. Thanks for the help 回答1: Another solution to the problem would be to

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

核能气质少年 提交于 2019-11-29 15:15:47
问题 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 click on the app icon again, onCreate() is called but the activity is not destroyed or restarted. Some variables change and that produces strange behaviours. This happens ONLY the first time the app is used. After force closing it, this behaviour won't

Canvas draw functions not working after screen locked and unlocked

谁都会走 提交于 2019-11-29 09:29:12
I'm working on an augmented reality application in which I have a camera preview screen on which I draw some markers which moves with respect to device movement. When I lock and unlock the device, the markers freezes and doesn't move further. I'm unable to find the reason why this happens.Is there any possible work around for this? Any help will be greatly appreciated. My SurfaceView class: public class CameraSurface extends SurfaceView implements SurfaceHolder.Callback { private static SurfaceHolder holder = null; public static Camera camera = null; Activity ctx; public CameraSurface(Activity