Mark Wyszomierski wrote:
> Hi,
> 
> I'm not sure why onPause() is not called in the following scenario.
> Here's my activity:
> 
> // launchMode = "singleTask"
> 
> public class ActivityMain extends Activity {
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
> 
>         Log.d("$$", "onCreate()..." + getTaskId());
>     }
> 
>     @Override
>     protected void onPause() {
>         super.onPause();
> 
>         if (isFinishing()) {
>             Log.d("$$", "onPause()..." + getTaskId());
>         }
>     }
> 
>     @Override
>     protected void onNewIntent(Intent intent) {
>         super.onNewIntent(intent);
> 
>         Log.d("$$", "onNewIntent()..." + getTaskId());
>         finish();
>     }
> }
> 
> I launch my activity from the app tray, then hide it by hitting the
> home key. So the app is running.
> I then launch the browser, do a url-click action which should launch
> this activity again (via an intent-filter).
> 
> I see the onNewIntent() method called. The task id and mem address is
> the same as the original instance, so I know this is the original one
> getting recycled. I do not see the onPause() method called though,
> even though finish() is being called. Shouldn't the call to finish()
> kill this one and only activity in this task?

I don't think onPause() will be called, because you never got to onResume().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 2.9
Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to