application-lifecycle

Execute a Windows Phone 8.1 Application after deactivation

倾然丶 夕夏残阳落幕 提交于 2019-12-11 10:49:39
问题 I know about the Windows Phone 8.1 Applications lifecycle: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff817008%28v=vs.105%29.aspx But, is it possible to keep active the application when it is not used (after deactivation)? Is it possible to realize a WP8.1 App that sends some data to a Server at predetermined time intervals? Is it possible to execute code in the App, when it is deactivated? 回答1: As you have tagged your question for WP8.1, apart from Silverlight apps, there

How to restart an app in UWP?

给你一囗甜甜゛ 提交于 2019-12-10 10:11:20
问题 Currently in my UWP application, I provide a way to change the app theme. But in order for the change to be effective, the user has to manually close the app and restart it. I'm looking for a way to do it automatically, ie, restart the app programmatically. Is it even possible? thank you. 回答1: According to a recent blog post, there is a new API for this "from Build 16226 onwards, along with the corresponding SDK." The new static RequestRestartAsync(String) method and overloads on

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

How to restart an app in UWP?

故事扮演 提交于 2019-12-05 18:57:30
Currently in my UWP application, I provide a way to change the app theme. But in order for the change to be effective, the user has to manually close the app and restart it. I'm looking for a way to do it automatically, ie, restart the app programmatically. Is it even possible? thank you. According to a recent blog post , there is a new API for this "from Build 16226 onwards, along with the corresponding SDK." The new static RequestRestartAsync(String) method and overloads on CoreApplication provide the previously unavailable app restart magic, including the ability to pass arguments to the

Android Application life cycle and singelton

北慕城南 提交于 2019-12-05 13:04:59
well most of us familiar with this pattern: public class MySingeltone { public String mSomeReferenceTypeData; public int mSomeValueTypeData; private static MySingeltone mInstance; private MySingeltone() { } public static MySingeltone getInstance() { if (mInstance == null) { mInstance = new MySingeltone(); } return mInstance; } } my problem is that I've found recently that the mInstance don't equal null after activity using him been destroyed, or when the whole application suppose to be clause, for example: public class SomeActivity extends Activity { @Override protected void onCreate(Bundle

Android Storing Socket.io object for multiple activities

余生颓废 提交于 2019-12-05 04:31:25
问题 I am making my first Socket.io based android application. The socket sends and receives data from a web service. There are a number of screens in the application for different features. How do i use the same socket connection in these different activities. I have tried setting and storing the Socket Object in the Application class and it appears to work well but when the application goes into the background and left there for some time the application is killed and the socket object is then

Android Storing Socket.io object for multiple activities

自古美人都是妖i 提交于 2019-12-03 20:48:28
I am making my first Socket.io based android application. The socket sends and receives data from a web service. There are a number of screens in the application for different features. How do i use the same socket connection in these different activities. I have tried setting and storing the Socket Object in the Application class and it appears to work well but when the application goes into the background and left there for some time the application is killed and the socket object is then NULL causing the aoo to crash with a null pointer exception. public class MyApplication extends

How to handle activity life cycle involving sockets in Android?

北城余情 提交于 2019-12-01 22:08:33
问题 I have an Android activity which in turn starts a thread. In the thread I open a persistent TCP socket connection. When the socket connects to the server dynamic data is downloaded. The thread sends messages using Handler-class to the activity when data has been received. Now if the user happens to switch from portrait to landscape mode the activity gets an onDestroy call. At this moment I close the socket and stop the thread. When Android has switched landscape mode it calls onCreate yet

How to handle activity life cycle involving sockets in Android?

孤者浪人 提交于 2019-12-01 21:44:44
I have an Android activity which in turn starts a thread. In the thread I open a persistent TCP socket connection. When the socket connects to the server dynamic data is downloaded. The thread sends messages using Handler-class to the activity when data has been received. Now if the user happens to switch from portrait to landscape mode the activity gets an onDestroy call. At this moment I close the socket and stop the thread. When Android has switched landscape mode it calls onCreate yet again and I have to do a socket re-connect. Also, all of the data the activity received needs to be

exit entire app at once

烂漫一生 提交于 2019-11-30 15:55:09
问题 I have used the code from here in my app, when I click on 'Cancel' option ,the app just minimizes ,when I long press and hold Home button and select the app.It shows the same screen not the splashscreen or the usual way the app starts - So I am assuming it just takes me to home screen. I am looking for a way I can close the main activity completely. I have tried the following methods and it crashed every time: finish(); mainactivity.class.finish(); opening an intent which has systemexit()