Android :: Bug In Activity Stack If Launching From Home Icon?

Jul 24, 2009

I've noticed some strange behaviour with resuming a task from a Home icon.Very easy to replicate, just create a new bare bones android project using eclipse, don't need to add anything. Then follow these steps:

1. In eclipse, Run the project on a emulator or device.

2. Once the app installs and launches the first activity, press Home key.

3. Launch the app again by pressing its icon.

4. Press Back key. Now this part seems wrong, you'll go back to the original activity in the stack, instead of the Home screen, even though its been previously launched and what you expect is it to bring back the stack as it was left, with one activity. If you repeat steps 2-3, it will just keep adding the same activity to the stack.

That is until you press Back all the way through the stack to the Home screen.Now this behaviour will never again replicate. It will be the correct (?) behaviour of bringing back the stack history at the state it was when Home was pressed. Note there are no behavioural modifications, this is just a default application. However, I tried many combinations of launchModes and stack clearing, they had no effect on the first run. Unless I'm interpreting the documentation wrong, when the user presses the Home key, the task is moved in to the background and simply brought back the next time they press the app icon? Why is the app icon altering the task it creates, if it already exists (with no flag modifications)?

Android :: Bug in activity stack if launching from Home icon?


Android :: Keep Task's Activity Stack After Restart From Home

Jan 13, 2010

My application has two activities, that I start in this order: HOME > A > B Now I press HOME and launch "A" again. I would like to see activity "B" on a top of "A", but instead I get "A" - so the activity stack is cleared. Manifest: <activity android:name=".activity.A" android:label="A" android:always Retain Task State = "true">What should I do?

View 2 Replies View Related

Android :: Task Activity Stack Always Reset When Launched From Home

Mar 24, 2009

I am just starting on an Android app and I am puzzled about why my Task activity stack is being reset any time the application is launched from the Home screen. I used the ADT tools to create the application in Eclipse. The main activity is ".UserLaunch" and it starts the activity ".About" when the user presses a button. If the user then presses HOME and then relaunches the app, .UserLaunch is displayed and is the only thing on the stack.

.UserLaunch has the launchMode singleTask. .About is standard. According to the documentation at http://developer.android.com/guide/topics/fundamentals.html#lmodes: "However, a "singleTask" activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.) "The Task stack should be brought to the foreground and .About should still be displayed. I added Logging to all of the lifecycle events (edited to remove timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see that when HOME is pressed, .About cycles through onPause and onStop (as expected). Then when the app is again launched, .About is destroyed and .UserLaunch is restarted D/UserLaunch:(670): onCreate() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.UserLaunch: 4910 ms I/ActivityManager(52): Starting activity: Intent { comp= {com.cequint.cityid/com.cequint.cityid.About} } D/UserLaunch:(670): onPause() D/About(670): onCreate() D/About(670): onStart() D/About(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.About: 1031 ms D/UserLaunch:(670): onStop() I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.HOME} flags=0x10200000 comp= {com.android.launcher/com.android.launcher.Launcher} } D/About(670): onPause() D/About(670): onStop() D/dalvikvm(670): GC freed 413 objects / 34128 bytes in 72ms I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} flags=0x10200000 comp= {com.cequint.cityid/com.cequint.cityid.UserLaunch} } D/About(670): onDestroy() D/UserLaunch:(670): onRestart() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() Here is the relevant section of the Manifest: <application android:icon="@drawable/icon" android:label="@string/ app_name"> <activity android:name=".UserLaunch" 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=".About" android:launchMode="standard"> </activity> </application> Anyone have any ideas why this is always resetting the Activity Stack?

View 11 Replies View Related

Android :: How To Create Icon On Home Screen Through Activity

Oct 7, 2009

I would like to have icon created on home screen through an activity . All the icons of my activities are on main menu, once i click it my activity will be launched instead i need an icon on home screen which when clicked activity should be launched.

View 4 Replies View Related

Android :: Want Titles Different On Home Icon Versus Activity

Aug 22, 2010

When the app starts up it shows the activity label property in the title bar. If you set a different title for the activity in onCreate that will show up later. You see the launcher activity title for a while and then the programmatic title replaces it, which is not very nice visually. The icon on the home screen uses the label for the activity. What I'm trying to do is get a label for the icon on the home screen that is different from the activity title bar. I tried setting the intent- filter label, but that didn't appear under the home screen icon. There is a label property for the application, the activity, and the intent-filter. The activity label is shown for the icon and the title and the other label properties are not shown.

View 4 Replies View Related

Android :: How To Set Running Activity When User Clicks On App Icon On Home Screen

Jun 17, 2010

I have Two activities One splash screen, Player screen. When user clicks on my app icon first splash screen is displayed and then player screen When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again.can any one please help me out how to do any one of below

1) I need to close current running activity and reload application.or
2) I need to resume to the player screen directly.Please give me an example or reference to follow, Im beginner in android programing.

View 3 Replies View Related

Android :: Stack Of Activity From Activity Stack

Nov 2, 2009

There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent.When i press home button and again when i press the executable it should start the activity where i have left .Is it possible?Any example related to the same would be great help

View 3 Replies View Related

Android :: How To Clear Activity Stack If Using Same Activity Multiple Times?

Mar 3, 2010

So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to "A" and the new page looks different, then a user clicks another button to go to "A" again. Now I have 2 Activities in the history stack. A, A, and currently on A. Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this?

View 5 Replies View Related

Android :: Finish Any Previous Activity In Stack From Current Activity?

Apr 27, 2010

How to finish any previous activity in application stack (at any level , I mean not immediate parent) , from current activity like on some particular event I want to invalidate this previous activity?

View 1 Replies View Related

Android :: Retain Only One Copy Of An Activity On Stack When Called From Non Activity

Jul 26, 2010

How can I make sure I only retain one copy of an activity on the stack when called from non-activity? When called from an activity I can just add the FLAG_ACTIVITY_REORDER_TO_FRONT flag to the Intent, but how can I do this from e.g. a widget or a notification?

View 1 Replies View Related

Android :: Disable Activity Slide-in Animation When Launching New Activity?

Feb 18, 2010

have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.

View 5 Replies View Related

Android :: Launching Activity From Status Bar Creates New Activity / Even When One Already Exists

Nov 9, 2010

I have an activity that starts a long-running service which in turn adds an icon to the status bar. When the activity gets invisible, e.g. by pressing the Home button, and the pressing the icon in the status bar a new activity is created instead of showing the already created activity. If you now press the back button the new activity is destroyed and the activity created in the first place gets visible. How do I make the invisible activity brought to front when pressing the icon in the status bar instead of creating a new activity?

View 1 Replies View Related

Android :: How To Clear All Activity In Stack Below Latest Activity?

Dec 22, 2009

All the current discussions involves clearing all activites above an existing activyt, but I'm trying to find a way to clear all the activities before the latest activity in the stack. So my scenario is A -> B -> C and then when a user goes to Activity D, activies A,B,C should be cleared from the activity stack. FLAG_ACTIVITY _CLEAR_TOP seems to only clear any activites above an existing activity. Anybody run into this scenario and found a solution?

View 4 Replies View Related

Android :: Clear Activity Stack And Replace With A New Activity

Sep 17, 2009

i want to clear the activity stack and replace it with a new activity as the root activity, even if that activity exists somewhere on the stack (or not). i see FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_NEW_TASK, but it's not obvious to me how to use those in conjunction to achieve what I want. it's like i want to completely restart the task with some activity that i specify as the new root.

View 9 Replies View Related

Android :: Make A Particular Activity As A Root Activity In Stack

Aug 4, 2009

i have a set of activities on my stack Say A-->B-->C. when i launch the activity named 'D' it should get fired as the root activity of my application and all the other activities(A,B,C) should get cleared from my stack once Activity D is launched.Can any one tell me as how to do this

View 4 Replies View Related

Android :: Strange Activity Stack Behavior When Using Map Activity

Apr 23, 2010

I have the following activity structure in my application A simple "splash screen" activity is started when the application is fired up (let's call it "Splash"). This activity starts the main activity when the user presses a button (I will call it "Main"). Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one "Form"), the second is a MapActivity that presents a map (it is called "Map").
Main, Form, and Map are declared exactly the same in the manifest:
<activity android:name="fully qualified activity class"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation"
> <intent-filter>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter> </activity> When Main is active and I start Form and press "back", Main comes up again. Pressing "back" again brings up "Splash". Nothing strange here.Now comes the strange part: when I am in Main, start Map, and press "back", Main comes up as expected. But pressing "back" again just restarts Main. A second press on "back" is needed to bring me back to Splash!So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not! Both Form and Map are started like this: start Activity(new Intent(this, MyActivity.class)); I don not catch the back key in any activity.Any clues on what is going on or how to debug this?

View 1 Replies View Related

Android :: Closing More Than One Activity In Activity Stack

Nov 4, 2009

I'm new android and i want to know how to remove more than one activity from stack. We use finish() for closing particular activity but i wanna close more than one activity underneath it, at a time.

View 2 Replies View Related

Android :: Handle Existing Instance Root Activity Launching Root Activity From Intent Filter

Apr 3, 2010

I'm having difficulties handling multiple instances of my root (main) activity for my application. My app in question has an intent filter in place to launch my application when opening an email attatchment from the "Email" app. My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity. steps: Launch root activity A, press home Open email attachment, intent filter triggers launches root activity A Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?

View 1 Replies View Related

Android :: Launching Home Replacement Application

Jun 4, 2009

Is it possible to launch other apps from my app like the application launcher or home screen do? I don't want to try a home replacement app. At least would a widget on home screen be able to launch other applications? Also can a widget on the (default) home screen receive swipe events (before a touch event)?

View 7 Replies View Related

Android :: Clear Activity Stack?

Nov 3, 2009

Is there a way to clear our Activity stack? For example, a user in my app progresses through these activities, one is launched from the previous activity: ActivityA -> ActivityB -> ActivityC if the user is now looking at ActivityC, and they hit the back button, they will go back to ActivityB. Is it possible to add a menu to ActivityC where the user can clear their activity stack, and then launch a new instance of ActivityA? This would be so the user can jump to a particular activity in my application without getting confused with the back button + history,

View 4 Replies View Related

Android :: Activity Stack Not Preserved

Mar 10, 2010

My main activity A has as set android:launchMode="singleTask" in the manifest. Now, whenever I start another activity from there, e.g. B and press the HOME BUTTON on the phone to return to the home screen and then again go back to my app, either via pressing the app's button or pressing the HOME BUTTONlong to show my most recent apps it doesn't preserve my activity stack and returns straight to A instead of the expected activity B.Is there a setting I'm missing or is this a bug? If the latter, is there a workaround for this until the bug is fixed?

View 5 Replies View Related

Android :: Way To Navigate Up Activity Stack?

Sep 20, 2010

My understanding is to quit the app I need to call finish() on all activities up to the root activity. However, how do I navigate up activities in app activity stack from current active activity?

View 12 Replies View Related

Android :: Traversing Activity Stack

Sep 1, 2010

how can I assure I always go back clicking on custom menu option to previous activity. I think it is a good idea to start new activities by startActivity(context, XActivity.class) but then when option is selected I should call finish on that activity or again call startActivity(this, previousActivityName)?on the other hand android has all activities on a stack so clicking goback button on a phone I will always go back to previous view, so how can I get this stack.

View 6 Replies View Related

Android :: Removing Stack Of Activity

Jan 7, 2010

I have 5 Activities in sequence Activity1, Activity2, Activity3, Activity4, Activity5.When I am at Activity5 there is a button through I can go to Activity2.Means jump from 5 to 2 with removing the Activity3 & 4.How can I do that?

View 7 Replies View Related

Android :: Resetting Activity Stack

Sep 22, 2009

Activities: A & B are activities that once you have navigated away from them it's not logical that you can get back to them using the back button. C X are activities that follow the usual "can go back to where you came from" flow.App flow: * Launch app from Home -> starts A * From A start B * Finish A (removes it from stack) * From B start C * Finish B (removes it from stack) * From C start D * From D start E.Once the user has reached E, the activity stack looks like this: C -> D -> E. Can I somehow reset the whole stack so it starts again at A so it's as the user just launched it from Home (so that C... E are removed from the history stack)?

View 3 Replies View Related

Android :: Activity History Stack

Aug 1, 2009

I have 3 activities, I want to allow only one of each of the activities to be on the history stack at one time.A>B>C>[GO TO B] gives me A>C>B using FLAG_ACTIVITY_REORDER_TO_FRONT flag.Now the problem is that when I call B from C I want B to be restarted not just brought to the front.how can I do that?

View 3 Replies View Related

Android :: Is There Way To Print Activity Stack?

Dec 15, 2009

Actually I was trying to automate some stuff on my android emulator. I start an activity through adb shell using "am" command, but when the activity starts do I have a way out to know that my activity is the one which is at the top & has the focus.I googled about it a lot but couldn't find the right way to do this.

View 2 Replies View Related

Android :: Not Understanding Activity Stack?

Dec 3, 2009

I'm having trouble with my activities when they go in the background. I have two activities, A and B. Only A can launch B (manifest copied below).This is very confusing. It's like Android knows my app is running, and puts a new instance of A on top of the old B instance running. I'd just expect that the application gets paused in-place, and whenever the user hits the app icon again, it just picks up where it left off (in this case, just show B again!) Below is the manifest, and the activity classes for this test are completely empty (except A which has a button to launch B).

View 4 Replies View Related

Android :: How To Reuse Activity On Top Of Stack

Jun 16, 2010

My app has a single entry activity called "Main". In "Main" I call one of three other activities A, B, or C (based on a preference) and then immediately exit/finish"Main" so that only A, B, or C are active.I also have a permanent notification in the notification bar that users can pull down (at any time) to conveniently restart my App (calls intent with "Main" component).The problem is that if my app is already running and users pull down the notification and restart, I get A or B or C running on top of the previous activity (also A, or B, or C). How can I avoid this (i.e. reuse the activity on top of the stack)?I've tried Intent.FLAG_ACTIVITY_* and nothing seems to work. I've tried launchModel in the Manifest and it also didn't seem to work.

View 1 Replies View Related

Android :: Access Activity Below In Stack

Sep 8, 2010

I have pushed one Activity to make few changes. Now I want to pass all the changes to the previous(below) Activity. I dont want to create Activity again;and intead i want to access the previous activity.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved