activity-lifecycle

How to prevent Android to restart application after calling camera intent?

百般思念 提交于 2019-12-10 09:43:25
问题 On low memory device I've got a problem after calling camera intent. When activity result should be received Android restart the whole app. Have anybody faced same problem? Is there any solution? 回答1: I faced the same issue a while ago: Android system stops application when launching Media Intent Apparently there is no solution, so you have to make sure that you save and restore the application state. 回答2: Well i think, the problem could be: Image byte array is too big such that it touches

Android - onStop() will be called with a delay

痴心易碎 提交于 2019-12-10 02:44:47
问题 I found my activities onStop() method will be called with a less than 10 seconds delay. I've never seen before this behavior. Note :- The activity is singleTop and it starts with Intent.FLAG_ACTIVITY_REORDER_TO_FRONT flag. Note :- I'm using Build Tools v23.0.2. The delay wasn't before and the method would be called immediately. 回答1: I am guessing that you are starting another activity and you expect the current activity to receive an onStop() callback. According to the activity lifecycle, the

Animation at the beginning of activity skips frames

萝らか妹 提交于 2019-12-09 11:29:22
问题 I am animating a view in an activity after onGlobalLayoutFinished is called on the view. My animation is skipping ~300 ms worth of frames in the beginning. If I delay the animation by more than ~300ms, it does not skip any frames. What is going on in the activity that is causing this to happen? How can I stop it or how can I listen for when it is finished? I have created a dead simple app to demonstrate this behavior. contents of <application> in AndroidManifest.xml: <activity android:name="

Kill Splash Screen When Click “BACK” Button

丶灬走出姿态 提交于 2019-12-08 12:33:10
问题 I have created a splash screen for my android app. My question is simple. After 5 seconds splash screen disappear and main activity works. Then if i click "Back" button it returns splash screen again. But i don't want this. If user touch "Back" button on mainactivity, app must go android menu without splash screen. How can i fix it? package com.example.androidfirst; import android.app.Activity; public class SplashActivity extends Activity { @Override protected void onCreate(Bundle

Detect other apps being launched and closed by external Service in Android

倾然丶 夕夏残阳落幕 提交于 2019-12-08 01:04:28
问题 I am currently trying to monitor applications being launched and closed under Android. I need to create Android Service app that accumulate statistics (Time, AppName) about starting and terminating selected apps. I clear understand Processes and Application Lifecycle https://developer.android.com/guide/components/activities/process-lifecycle.html And I know how to detect running app How can I check if an app running on Android? Anyway are there any Android events to sucbscribe to listen for

Starting too many activities?

十年热恋 提交于 2019-12-07 18:05:09
问题 Hello is it possible to start like too many activities during the runtime of an application? I'm developing a schedule application where you can slide from day to day where each day is a new activity. Now I'm wondering if there is a limit somehow of the number of activities you should start max. As when sliding a bit around you are soon to about 20 activities which are active. I know activities will be killed when other applications need memory but while testing and closing the application by

Why would Application sometimes restart on killProcess?

会有一股神秘感。 提交于 2019-12-06 21:52:09
问题 Ordinarily, exiting my application by calling: android.os.Process.killProcess(android.os.Process.myPid()); performs well without incident. But every once in a while, the application will restart again (after exiting!). The relevant log snippet shows: .631: I/Process(15495): Sending signal. PID: 15495 SIG: 9 .641: W/AudioFlinger(121): write blocked for 252 msecs, 1279 delayed writes, thread 0xdc18 .651: I/ActivityManager(164): Process com.ef.myapp (pid 15495) has died. .651: I/WindowManager

what exactly android's home button doing?

二次信任 提交于 2019-12-06 16:53:59
What I do know is that the current activity get into the onPause() mode, and the home screen activity brought to front. My confusion starts with situation you can re-open the application from the recent tasks menu. so what exactly happening when I'm opening the application from the recent tasks manager? Is the activity that was foreground when the home button pressed is still somewhere in the stack? Is there more then one activity stack on the same time? As far as I understand it, there is no real stack (of applications). Is just that your activity has states, so whenever you are pressing the

Overlapping Fragments when resuming Activity

无人久伴 提交于 2019-12-06 09:22:09
问题 I have a problem with my android app, I'm developing with Android STUDIO IDE. Pretty much when I leave the app in the background for a few minutes, or is killed by the system or I mix the different layouts of the fragment. I have put a picture below: I've already tried a variety of methods, if you have others write as well. Thank you in advance. super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ViewPager pager = (ViewPager) findViewById(R.id.pager); pager

Starting too many activities?

这一生的挚爱 提交于 2019-12-06 03:51:34
Hello is it possible to start like too many activities during the runtime of an application? I'm developing a schedule application where you can slide from day to day where each day is a new activity. Now I'm wondering if there is a limit somehow of the number of activities you should start max. As when sliding a bit around you are soon to about 20 activities which are active. I know activities will be killed when other applications need memory but while testing and closing the application by pressing the home button with about 20 activities 'running' htc sense seems to be restarting like it