On quick inspection your app looks almost like the one I tested. My
test is with the emulator with Android 2.0.1.  I am NOT running this
from eclipse.   Any difference from your scenario?

What do you mean by "resume" in your scenario?  Do you mean pulling
down the tray and clicking on the App icon again?

On Feb 18, 12:53 pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> Hi jotobjects, that would be really helpful if you could post your
> example. My simple example is below. Behavior I am seeing is:
>
>  -App Tray
>  -ActivityA
>  -btn click, start ActivityB
>  -home button
>  -resume
>  -ActivityA is shown
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
> import android.view.View;
> import android.view.View.OnClickListener;
> import android.widget.Button;
>
> public class ActivityA extends Activity {
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.activitya);
>
>         Button btn = (Button)findViewById(R.id.btn);
>         btn.setOnClickListener(new OnClickListener() {
>             public void onClick(View arg0) {
>                 Intent intent = new Intent();
>                 intent.setClass(ActivityA.this, ActivityB.class);
>                 startActivity(intent);
>             }
>         });
>     }
>
> }
>
> import android.app.Activity;
> import android.os.Bundle;
>
> public class ActivityB extends Activity {
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.activityb);
>     }
>
> }
>
> <activity android:name=".ActivityA"
>   android:label="@string/app_name"
>   android:launchMode="singleTask">
>   <intent-filter>
>     <action android:name="android.intent.action.MAIN" />
>     <category android:name="android.intent.category.LAUNCHER" />
>   </intent-filter>
> </activity>
>
> <activity android:name=".ActivityB"
>   android:label="@string/app_name">
>   <intent-filter>
>     <action android:name="android.intent.action.VIEW" />
>     <category android:name="android.intent.category.DEFAULT" />
>   </intent-filter>
> </activity>
>
> Thanks
>
> On Feb 18, 10:18 am, jotobjects <jotobje...@gmail.com> wrote:
>
> > Just curious since you and others have asked similar questions in the
> > past.  I just wrote a simple App with ActivityA and ActivityB where A
> > issingleTasklaunchMode.  If I go A->b->Home->relaunch I get gack to
> > B.  So I cannot replicate the scenario you describe.  The code and all
> > files for the app are just a couple of dozen lines so I can post if
> > here if that would be helpful to figure out what you are doing
> > differently than my test.
>
> > On Feb 18, 7:09 am, Mark Wyszomierski <mar...@gmail.com> wrote:
>
> > > Hi,
>
> > > I have an activity, ActivityA, and its launchMode is set to
> > > "singleTask".
>
> > > I start the application from the app tray. ActivityA launches
> > > ActivityB from a button click. ActivityB is a normal activity with no
> > > launchMode set ("standard").
>
> > > With ActivityB on top of the activity stack, I hit the home button,
> > > then resume the app, I see ActivityA instead of ActivityB when
> > > resumed.
>
> > > Shouldn't the history stack be preserved in this case, and B be
> > > showing? When I resume, I see A get onNewIntent() called, and I'm not
> > > sure why this is happening. I thought the stack would be preserved.
>
> > > Thanks

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

Reply via email to