Tell if Activity was started from launcher or navigated back to back button?

Yes it is possible to launch a dialog box only when the main activity starts the first time, but I save state on a soft kill. So if you save state in onSaveInstanceState on a soft kill you can look for a null bundle in onCreate. If the bundle is null, then this is the first launch.

If the bundle is not null, then you are returning from a soft kill. If you save state in onRetainNonConfigurationState then the code looks like: RESTORE STATE HERE // Save state in onStop (prefs) and onRetainNonConfigurationInstance (ConfuseTextState) state= (ConfuseTextState)getLastNonConfigurationInstance(); if (state! = null) { // at least second pass, get non view state from onRetainNonConfigurationInstance try { this.

IsShowCharCount= state. IsShowCharCount; this. TimeExpire= state.

TimeExpire; this. TimeoutType= state. TimeoutType; this.

IsValidKey= state. IsValidKey; this. Password= state.

Password; this. IsAutoLaunch= state. IsAutoLaunch; //Log.

D(TAG,"restoredStateFromLastConfiguration"); } catch(Exception e){ Log. D(Utilities. TAG,"FailedToRestoreState",e); } } else { // first pass, get saved state from preferences on first pass if they exist // Restore preferences (8) on hard kill when USER hit back and killed us SharedPreferences prefs = getPreferences(MODE_PRIVATE); // singleton if (prefs!

= null){... } // else state is from xml files and default instance values // SUPPORT EASY LAUNCH if (isAutoLaunch){ // launch on first show only this. ShowDialog(DIALOG_EASY_LAUNCH).

Yes it is possible to launch a dialog box only when the main activity starts the first time, but I save state on a soft kill. So if you save state in onSaveInstanceState on a soft kill you can look for a null bundle in onCreate. If the bundle is null, then this is the first launch.

If the bundle is not null, then you are returning from a soft kill. If you save state in onRetainNonConfigurationState then the code looks like: // RESTORE STATE HERE // Save state in onStop (prefs) and onRetainNonConfigurationInstance (ConfuseTextState) state= (ConfuseTextState)getLastNonConfigurationInstance(); if (state! = null) { // at least second pass, get non view state from onRetainNonConfigurationInstance try { this.

IsShowCharCount= state. IsShowCharCount; this. TimeExpire= state.

TimeExpire; this. TimeoutType= state. TimeoutType; this.

IsValidKey= state. IsValidKey; this. Password= state.

Password; this. IsAutoLaunch= state. IsAutoLaunch; //Log.

D(TAG,"restoredStateFromLastConfiguration"); } catch(Exception e){ Log. D(Utilities. TAG,"FailedToRestoreState",e); } } else { // first pass, get saved state from preferences on first pass if they exist // Restore preferences (8) on hard kill when USER hit back and killed us SharedPreferences prefs = getPreferences(MODE_PRIVATE); // singleton if (prefs!

= null){... } // else state is from xml files and default instance values // SUPPORT EASY LAUNCH if (isAutoLaunch){ // launch on first show only this. ShowDialog(DIALOG_EASY_LAUNCH).

I'm developing an app that dynamically creates launcher Icons (to specific datasets within the app) on user request by broadcasting a com.android.launcher.action. The broadcasted intent specifies the dataset id in its extras. When I start the app using one of these shortcuts, I read the Intent extra data in onCreate and display the desired entry.

Now while that works the first time, when the user doesn't exit the activity using the back button it gets recycled the next time one of the icons is clicked. OnResume, onRestart and onStart are called but when I use getIntent() inside them, I get the original intent data. So is it possible to reuse the activity (i.e.

Not call finish() in onPause() or onStop() but still get the correct intent extras every time?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions