lifecycle

Windows 8 Winrt Application goes to background or close

删除回忆录丶 提交于 2019-11-27 15:46:20
How can you tell when a windows 8 Metro app gets put in the background? The suspended state doesn't activate. I have a break point on. It only hits if I close the app. I am using a webcam and since no apps can run in the background I need to save my work when it's put in the background. The windows phone it was application deactivated. any help would be nice. Apps do not normally get suspended when in the debugger. However, you can force a suspend when debugging by: Enabling the Debug Location toolbar (red arrow in image below). Then press the Suspend button (blue arrow). The suspending event

Problems understanding the life cycle when screen goes off and on

若如初见. 提交于 2019-11-27 12:55:44
问题 Information: My device is a Nexus One with 2.2 and I have tested two projects, one on 1.5 and one on 2.1. Problem: I have trouble to understand the life cycle of my application when the screen is turned off and on. Here is my output // activity starts 08-04 17:24:17.643: ERROR/PlayActivity(6215): onStart executes ... 08-04 17:24:17.643: ERROR/PlayActivity(6215): onResume executes ... // screen goes off 08-04 17:24:28.943: ERROR/PlayActivity(6215): onPause executes ... 08-04 17:24:32.113:

Ninject caching an injected DataContext? Lifecycle Management?

微笑、不失礼 提交于 2019-11-27 12:07:58
问题 I had a series of very bizarre errors being thrown in my repositories. Row not found or changed, 1 of 2 updates failed... Nothing made sense. It was as if my DataContext instance was being cached... Nothing made sense and I was considering a career move. I then noticed that the DataContext instance was passed in using dependency injection, using Ninject (this is the first time I have used DI...). I ripped out the Dependency Injection, and all went back to normal. Instantly. So dependency

What is the lifecycle and concurrency semantics of Rhino Script Engine

孤者浪人 提交于 2019-11-27 11:43:45
问题 I am interested in the lifecycle and concurrency semantics of (Rhino) Script Engine and associated classes. Specifically: Is Bindings supposed to be thread safe? Should multiple threads be allowed to share a single ScriptEngine instance? ... or should each thread construct a short-lived instance? ... or keep them in a pool? What happens if multiple threads concurrently call ScriptEngine.eval(...) ? Same questions for CompiledScript instances Same questions for interface implementations

How to test code built to save/restore Lifecycle of an Activity?

喜夏-厌秋 提交于 2019-11-27 11:29:54
问题 How can I test all of the following methods code? I want to play scenarios when all of them are happening to see if my code works for save/restore process of an activity. So what should I do in the Emulator to get all methods tested? public class Activity extends ApplicationContext { protected void onCreate(Bundle savedInstanceState); protected void onStart(); protected void onRestoreInstanceState(Bundle savedInstanceState); protected void onSaveInstanceState(Bundle savedInstanceState);

How do I preserve a complex object across Activity restarts?

ぃ、小莉子 提交于 2019-11-27 09:52:54
问题 Say I have a Java Bean object which is serializable. I want to store it away safely when an Activity goes through onDestroy() on purpose (i.e. onSaveInstanceState() is not called). I am looking for a way which doesn't involve creating a database and write the object to that (mostly since a) Android's DB API is horrible and b) since databases make application updates a nightmare, because there is no decent support for applying migrations). I thought about serializing the object to a

SQLite or SharedPreferences for persistent data storage?

寵の児 提交于 2019-11-27 09:27:22
For persistent storage of data is there any distinct advantage of using a SQLlite database over SharedPreferences or vice versa? Currently my application data is only a couple of kilobytes in size, though it could conceivably rise to ten times that size in the future. I can't find anywhere that states how much storage is available using SharedPreferences but would imagine this would be one limitation of using it? Is there any difference in speed between the two methods? I'm looking to weigh up the pros and cons of those two storage methods. Off the top of my head: SharedPreferences: Pro:

Application_End global.asax

白昼怎懂夜的黑 提交于 2019-11-27 09:11:06
Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered? The application_end event primarily fires when the IIS pool is recycled or the application itself is unloaded. One other thing to note, that a change to a dependent file (say web.config) will cause the application to reload itself, which will in cause the application_end event to fire while it is closing itself off. To note, the only instance I found of the

Is there any lifecycle hook like window.onbeforeunload in Angular2?

梦想与她 提交于 2019-11-27 06:57:49
Is there any lifecycle hook like window.onbeforeunload in Angular2? I already googled and searched on stackoverflow, but found nothing <div (window:beforeunload)="doSomething()"></div> or @Component({ selector: 'xxx', host: {'window:beforeunload':'doSomething'} .. )} or @Component({ selector: 'xxx', .. )} class MyComponent { @HostListener('window:beforeunload') doSomething() { } } This is how to listen to global events. I don't know if the special behavior of this event is supported where the return value is used as text for the conformation dialog. You can still use export class AppComponent

Android Fragment onCreateView vs. onActivityCreated

社会主义新天地 提交于 2019-11-27 06:11:09
I know that a fragment's view hierarchy has to be inflated in onCreateView, but what other functionality can be in onCreateView vs. what should wait for onActivityCreated? My current implementation uses separate activities for everything, and a typical activity does most of its work in its onCreate method, including inflating the view, setting the content view, initializing the various widgets with data, setting up listeners, etc. So can this probably all be moved into onCreateView, or should some functions be put into an onActivityCreated method instead? If your view is static, then moving