[android-developers] Re: singleTask + activity stack not preserved?

2010-04-13 Thread dmori
Hello jotobjects and all, The application below works for me in 1.5 (G1) and 1.6 (Tattoo), I was puzzled to see singleTask working as expected, mine (which overall is equivalent) didn't. Unfortunately the reason the application below works is because it has a bug: launchMode= is not the same as

[android-developers] Re: singleTask + activity stack not preserved?

2010-03-10 Thread Stefan Klumpp
+ If there is no intent_filter listed then even with launchMode=singleTask re-launch from Home returns to the last activity in the task. Okay if removing all intent-filter entries in the manifest is the solution (or temp. workaround) how do then start your application? Don't you need at least

[android-developers] Re: singleTask + activity stack not preserved?

2010-03-10 Thread jotobjects
On Mar 10, 5:06 am, Stefan Klumpp stefan.klu...@gmail.com wrote: + If there is no intent_filter listed then even with launchMode=singleTask re-launch from Home returns to the last activity in the task. Okay if removing all intent-filter entries in the manifest is the solution (or temp.

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread ANithian
I am glad to have run across this thread because I was noticing the same behavior. I am running Eclipse 3.5 with the emulator 2.0.1 (Google APIs). With my application, the same behavior described happens: 1) Launch App -- Main Activity 2) From Main Activity, click button to next screen 3) Hit

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread jotobjects
The discussion in this thread is about behavior with singleTask launchMode that is either undcoumented or buggy. Your scenario is a completely different topic since it is not related to singleTask launchMode. There have been several mentions of behavior similar to what you describe when running

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread Mark Wyszomierski
Yeah @Amit, I logged a bug about this behavior here: http://code.google.com/p/android/issues/detail?id=5277can=4colspec=ID%20Type%20Status%20Owner%20Summary%20Stars the loss of the history stack seems to happen any time you launch an activity with the FLAG_ACTIVITY_NEW_TASK flag. Try it out with

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread jotobjects
On Feb 22, 12:07 pm, Mark Wyszomierski mar...@gmail.com wrote: Yeah @Amit, I logged a bug about this behavior here: http://code.google.com/p/android/issues/detail?id=5277can=4colspec=... the loss of the history stack seems to happen any time you launch an activity with the

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread Mark Wyszomierski
Hey jot, yeah this thread is getting mixed up, but that bug I filed I think is at best confusing behavior. You launch an app after installing it from market, navigate to ActivityB, home screen, resume, and you're back to ActivityA - I don't think that makes any sense to users. Drove me crazy the

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-22 Thread ANithian
All, I didn't mean to confuse the thread and I'm sorry for this. I came across this thread and even tried to set the launch mode to singleTask (on the main activity) to no avail. That is why I posted what I did thinking it was related to this thread. I couldn't ever get the behavior where

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-20 Thread jotobjects
On Feb 19, 2:11 pm, jotobjects jotobje...@gmail.com wrote: // 2-This does not work - exception is can't find Activity to handle Intent Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory(foo.singletask.intent.category.FOO); Fixed that problem - if a category is listed in the

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Wyszomierski
Hi jotobjects, Yes I am running it as you described, here it is exactly: -Run emulator (same on g1 running 1.5) -Make sure all instances of app are killed (not running from eclipse) -Start app from app tray, ActivityA is created -ActivityA launched ActivityB via button click -Home button -Open

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
Yes in the last step I get back to ActivityB and you get back to ActivityA so that's different behavior. The only environment difference apparently is that your test is with 1.5 and my test is with 2.0.1, but it doesn't seem like this core behavior would have changed. Here is my app. I'll test

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Wyszomierski
Thanks for posting, I'll make a new project with your code to test. Although my G1 is running 1.5, my emulator is using 2.0, so it should be testing both situations. Will try yours now, Thanks On Feb 19, 11:21 am, jotobjects jotobje...@gmail.com wrote: Yes in the last step I get back to

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Wyszomierski
Ok so yours work, and I see the change that causes my version to lose its history: // Yours - works: private OnClickListener gotoBClickListener = new GotoBClickListener(); public void onCreate(Bundle savedInstanceState) { button.setOnClickListener(gotoBClickListener); } // Mine - does not

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
We have the same results but different analysis. Same results - my app goes back to ActivityB and your app goes back to ActivityA. Different analysis - I do NOT think the click listener definition makes any difference (just a difference in style but functionally the same). What I DID notice is

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
If I remove this from your ActivityB in the Manifest then they behave the same. intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / /intent-filter I think it because we are NOT invoking this Intent in the button. I

Re: [android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Murphy
jotobjects wrote: If I remove this from your ActivityB in the Manifest then they behave the same. intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / /intent-filter I think it because we are NOT invoking this

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
On Feb 19, 12:49 pm, Mark Murphy mmur...@commonsware.com wrote: That intent filter is scary. You're basically saying you're able to view *anything*. I guess that's what it means! When I changed the onClick code to this - public void onClick(View arg0) { Intent

Re: [android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Murphy
jotobjects wrote: Um. where are we now? I'm right here. :-) What SHOULD the Intent filter look like? If you are only starting an activity using an Intent with the component name (e.g., new Intent(this, ActivityB.class)), you don't need an intent-filter at all. -- Mark Murphy (a Commons

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
On Feb 19, 1:10 pm, Mark Murphy mmur...@commonsware.com wrote: What SHOULD the Intent filter look like? If you are only starting an activity using an Intent with the component name (e.g., new Intent(this, ActivityB.class)), you don't need an intent-filter at all. Yes agreed - in fact when

Re: [android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread Mark Murphy
jotobjects wrote: So there are two problems/questions here - - why does the existence of the intent filter change the behavior after Home is visited? Beats the heck out of me. - what is a more rational kind of Intent filter that won't overlap with many other Activities? Should we make up

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-19 Thread jotobjects
These are my results of trying it 3 different ways - // 1-This loses task history after visiting Home // Intent intent = new Intent(foo.singletask.intent.action.FOO); // intent.addCategory(Intent.CATEGORY_DEFAULT); #2 is a mstery. It causes a force close. Don't understand why. // 2-This does

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-18 Thread jotobjects
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 is singleTask launchMode. 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

[android-developers] Re: singleTask + activity stack not preserved?

2010-02-18 Thread Mark Wyszomierski
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-developers] Re: singleTask + activity stack not preserved?

2010-02-18 Thread jotobjects
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