Android :: Home Button Not Resuming Last Activity

Sep 23, 2010

I am trying to solve an issue sort of similar to what was done here (link text)Except in my case where Activity A, started Activity B, started Activity C, when the user resumes the app after pressing the home button - I want C, the last Activity, to be displayed. Instead what is happening is I am back to A.Also on a side note I have discovered that even when I exit the application, if I hold down the Home button, my app is still listed as an active app even though in the LogCat I can see that it exited OK.Also, in case it matters, I did recently add android:launchMode ="singleTask" in order to make some notification logic work correctly. I was seeing the Home button behavior before that though.

Activity B actually has several Activities that it chooses from (it has a list of Intents) to display based on input it receives but launches them all the same way as Activty A launched B. Once the first Activity is displayed the user swipe the screen to navigate to the left or right screen. When the user swipes left or right, the current activity puts info in its return Intent that Activity B uses to display the next Activity. Also since logic outside of the user's control could prompt a change in the screen displayed, each Activty calls finish on itself in onStop to avoid back-button issues.

Android :: Home button not resuming last Activity


Android :: Android Intent / Resuming Application Home Activity

Jul 10, 2010

I have an application that I have running a media player and I want to resume the activity from my applications home activity. I can successfully do this by adding the following flags to the startActivity Call:
myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
I am worried that this is not an ideal way to do things since it took me a long time to find it. It made me think that no one uses it very much. Are there any pitfalls to using this method?

View 1 Replies View Related

Android :: How To Control Activity Flow - Back Button Versus Home Button

Sep 2, 2010

I have 3 activities in my app: Activity1 -> Activity2 -> Activity3. Inside Activity3, if the user presses Back, I would like to return to Activity2. In Activity3's onPause event, I added a finish() statement. That's probably not even necessary, but I wanted to make sure this Activity gets cleaned up. This works fine.
However, while in Activity3, if the user presses Home or starts a new app (through notification bar or some other means), I want both Activity3 and Activity2 to finish. If the user returns to this app, he should resume with Activity1.

I have figured out how to do one or the other, but I can't figure out how to handle both cases, if it's even possible. Can I trap the "Back" button in Activity3 and send a message back to Activity2 telling it not to finish()? It seems like the Activities follow the same lifecycle flow (Pause, Stop) regardless of what you do to send them to the background. Just to answer the question of why I want this behavior, imagine that Activity1 is a login screen, Activity2 is a selection screen, and Activity3 is a content screen. If I press Back from the content page, I want to be able to make a new selection. If I exit via any other means (Home, notification bar), I want the user to be "logged out".

View 2 Replies View Related

Android :: Resuming An Activity From Notification

Mar 5, 2010

I have a notification in the status bar for my app.The problem with this is that when you press the home button from the app (pushing it to the background) then press on the notification in the list accessed from the status bar, it starts a fresh copy of the activity. All I want to do is resume the app (like when you longpress the home button and press on the app's icon). Is there a way of creating an Intent to do this?

View 1 Replies View Related

Android :: Restoring Active Activity While Resuming Application

Apr 7, 2009

I have two activities running: MainActivity and ChildActivity. Whenever the user clicks in the button in MainActivity, the ChildActivity is launched. What I want to do is this:When the active activity is the ChildActivity and the user clicks the home button then relaunch the application (like opening from the beginning), I want to see the ChildActivity instead of MainActivity that is launched. However; This is happening only when the user clicks from recent activities window. (the window opened when you long press the home button).I had some suggestions actually work arounds and I tried to manipulate onStart, onRestart, onResume, onStop, onDestroy events. But, they didn't fully solve the problem. There should be a smart way out there.

View 8 Replies View Related

Android :: Restoring Active Activity / While Resuming Application

Apr 7, 2009

I have two activities running: mainActivity and childActivity. Whenever the user clicks in the button in mainActivity, the childActivity is launched. What I want to do is this:When the active activity is the childActivity and the user clicks the home button then relaunch the application, I want to see the childActivity instead of mainActivity that is launched.I had some suggestions actually work arounds. I tried to manipulate onStart, onRestart, onResume, onStop, onDestroy events. But, they didn't fully solve the problem.

View 3 Replies View Related

Android :: Home Button - Does Not Show The Last Activity

Jan 23, 2010

I'm experiencing kind of strange behavior of my application after hard Home button is pressed. When you press Home, everything is OK - my app goes to the background, showing Home screen. But if you try to choose my app in the main menu or in the list of last tasks it behaves like it was not started before and does not show the last activity you were on - it just starts from scratch, namely, shows the splash screen and starts next corresponding activities. Moreover, old activities of this app remain on the activities stack, and previous instance of the app is not terminated - so if you press Back for a few times you'll just run into those activities which were undoubtedly started during the previous session of work with my app. Splash screen activity is filtered by "android.intent.action.MAIN" filter and "android.intent.category.LAUNCHER" category. The strange thing is that all of that happens despite the fact that I do not intercept any Back key hits, or override any onPause or onResume methods. What's happening contradicts with my understanding of Android app lifecycle - I was sure that when you hit Home an app just goes to the background, and when you choose it in the menu later - it just unwinds and does not start anew. (Of course, unless stuff like that is stated in the app manifest or corresponding methods are overridden or something else). I also checked it for some other lifecycle events - such as changing orientation or flipping hard keyboard out - and none of those led to such strange results. It appears that the problem occurs when you try to start the app from main menu or menu of last applications.

View 1 Replies View Related

Android :: 1.5 And 1.6 After Calling Finish Activity And Home Button

Jan 12, 2010

I open splash screen at the end i call finish() then i moved to browse page. At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature) When i go to Android's desktop launch application again it starts from splash screen. Android Platform 1.6

I open splash screen at the end i call finish() then i moved to browse page. At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature) When i go to Android's desktop launch application again it always starts from browse screen instead of splash screen why is that..............

View 1 Replies View Related

Android :: Exit Current Activity To Homescreen (without Using Home Button)?

May 3, 2010

What I am trying to do is emulating the "Home" button which takes one back to Android's homescreen. So here is what causes me problems: I have 3 launcher activities. The first one (which is connected to the homescreen icon) is just a (password protected) configuration activity. It will not be used by the user (just admin) One of the other 2 (both accessed via an app widget) is a questionnaire app. I'm allowing to jump back between questions via the Back button or a GUI back button as well. When the questionnaire is finished I sum up the answers given and provide a "Finish" button which should take the user back to the home screen.

For the questionnaire app I use a single activity (called ItemActivity) which calls itself (is that recursion as well when using intents?) to jump from one question to another:

Questionnaire.serializeToXML();
Intent i = new Intent().setClass(c, ItemActivity.class);
if(Questionnaire.instance.getCurrentItemNo() == Questionnaire.instance.getAmountOfItems()) {
Questionnaire.instance.setCompleted(true);
} else Questionnaire.instance.nextItem();
startActivity(i);

The final screen shows something like "Thank you for participating" as well as the formerly described button which should take one back to the homescreen. But I don't really get how to exit the Activity properly. I've e.g. used this.finish(); but this strangely brings up the "Thank you" screen again. So how can I just exit by jumping back to the homescreen?

View 2 Replies View Related

Android :: State Of Activity Saving When Home Button Pressed

Oct 24, 2009

I am having an issue related to home key . when i press home key all current activity gets hidden. but when i press the executable it again starts from the fisrt screen . I have overidden all methods nsaveInstaceState opPause onStop onResume

but there are still issues what is the right way to handle those conditions. When i am pressing home button i am storing the widgets state in database and when i again click the exectable i am checking the database state and starting the new Intent as saved when user presses the home button .Is it the right way to do that as i am facing the problem when user does the same and again presses the back button , there is already on intent available in stack of activity .

View 2 Replies View Related

Android :: How To Close An Activity When User Clicks On Home Button

Feb 19, 2010

I understand that trying to capture home button clicks is a hack, but I need to atleast close my current activity when the user clicks on home button. Is there anyway I can tell the system to close this activity is the user clicks on home button? If so how can I do that? I need to do it as I am listening for location updates and I want to stop the updates and also need to trash any location that was available to me previously. I need to do this just in case any user while in that activity clicks on home button and changes the location settings.

View 7 Replies View Related

Android :: Activity State On Pressing Back And Home Button On Screen

May 6, 2009

Whenever I press the home button when Im in the root task of my application and when I click on the icon of my app again the state of my task (activity) is retained, but when i press the back button on the emulator and when I open my application its state is not retained. I want the state to be retained in both the scenarios.

In the mnifest I have given the below entries,

android:alwaysRetainTaskState="true" for the root activity

android:launchMode="singleTask" for the application

View 2 Replies View Related

Android :: Home Button On Samsung Galaxy Tablet Is Causing My Activity To Re-launch

Nov 22, 2010

On my droid phone, I get what I consider a proper pause/stop/resume/restart sequence when the home button is pressed and I then select my application. However, I'm testing on a new Samsung Galaxy tablet and when I select my application after having pressed the home button, a new activity is being launched. I do not understand why the behavior is different on the Galaxy. Any ideas? I have removed orientation config changes in the manifest, so it's not that.

View 1 Replies View Related

Android :: Launch The Same Activity From Widget With Different Extras - Prevent Same Instance Show Up After Returned From HOME Button?

Nov 5, 2010

I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set up the pendingIntent with extras with stock symbol. After I hit button A, it goes to Quote activity that shows stock A. Then I hit the BACK button to the homescreen, Quote activity calls onDestroy() and when I hit button B, stock B will show properly. However, when i hit HOME button after it shows stock A, the Quote activity only calls onStop without calling onDestroy(), then as i hit button B, it will call onStart() and it shows the same instance that shows stock A.

CODE:............

Originally I thought adding a flag in the Intent should solve this problem. But I have tried
i.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_NO_HISTORY), none of them makes any difference.

So is there any ways to make it work? How can i remove the history stack from HOME button? How can I call onCreate in Quote activity and get new extras when i hit button B?

View 4 Replies View Related

Android :: Using Any App And Press Home Button Home Screen Blacks Out - 10 Sec Delay Get All Icons Back

Mar 30, 2010

Whenever I am using any app and press the home button, the home screen blacks out for a few secs and it takes around 10 sec to get all the icons back and before I can start using my phone again. I am using a non rooted mytouch 3g.

This problem does not happen if I exit an app by pressing the back button. It becomes very annoying at times.

View 7 Replies View Related

Android :: Overriding Home Button For Car Home Replacement Application

May 19, 2010

I have been working on a replacement for the stock Car Home app for a bit, and I am completely stumped on how to override the Home button so that my app will be brought back to the foreground whenever the phone is docked. This is the way that Car Home works, so there must be a way. It seems that BroadcastReceivers won't work, because the intent that is broadcast whenever the Home button is pressed will still cause the default homescreen app to launch; I cannot prevent it. I can override the Home button from within my app, but that does me no good since this needs to work when the user is outside my app. Car Home also does not do anything weird like set itself as the default homescreen app while it's running (I checked the logcat to make sure).
I've been really beating my head against the wall on this. Does anyone have any ideas, or can you at least point me in the right direction?

View 3 Replies View Related

Android :: Overriding The Home Key Long Press In A Category - HOME Activity

May 29, 2010

I just created my own "Home" to replace the stock android one or Sense.

All is working fine and I get all I want. My only problem is to replace to long press on home key ( that usually show the last 6 activities you launched) by my own launcher.

I successfully replace the long press on MENU button with this code:

CODE:..........

and this part part for the long press:

CODE:.............

But the problem is that I wasn't able to replace the KeyEvent.KEYCODE_MENU with KeyEvent.KEYCODE_HOME

Is that something locked in the code that avoid user to use a Home long press?

View 1 Replies View Related

Android :: Hide And Activity When Activity On Top Redirecting To Home Screen

Mar 3, 2010

example scenario is: from login screen - main screen - then when i clicked a hide button inside the mainscreen, the app will need to go in the home screen, and when im going to click the app again the main screen would be called and not the login screen

View 3 Replies View Related

Android :: How To Clear Activity From Second Activity Going Back To Home Screen?

Mar 3, 2010

example scenario is: from login screen - main screen - then when i clicked a hide button the app will go to home screen, and when im going to click the app again the main screen would be called.

View 2 Replies View Related

Android :: Starting Second Activity From Main Activity On Button Click

Dec 4, 2009

Need an example of how to create/start a new activity from the main activity. I have a button click event on the main layout. Originally I just used setContentView(R.layout.secondactivity); which brings up the layout but I don't think that is correct since the secondactivity class is not instantiated at this point yet. I have looked for such an example and can not find one.

View 3 Replies View Related

Jelly Bean :: Galaxy S4 Home Button Not Taking Phone To Home?

Jan 11, 2014

it keeps acting as if I long pressed it when I only click it once.

View 2 Replies View Related

KitKat 4.4 :: Droid Maxx - Home Button Goes To Home Screen After Update

Jan 25, 2014

I updated my Droid Maxx to 4.4. The change I first noticed is that the home key takes you back to the home screen instead of just leaving an app and returning to the screen I was originly on. This is definitly new. Is there a way to turn it off?

View 16 Replies View Related

General :: Lock Button Isn't Working / Home Button Gives Power Screen (Samsung Vitality)

Jul 26, 2012

My phone was working just fine and randomly the lock button stopped working and the home button brings up the power screen!

View 1 Replies View Related

HTC Droid Eris :: Home Option When Pressed Home Button

Mar 8, 2010

Where is this from i noticed it when i got the app pandahome I have deleted the app but it still is there. So what is it . Is it from panda home and if so should I take it off and how.

View 4 Replies View Related

Samsung Captivate :: Home Screen When Hitting The Home Button

Jul 21, 2010

Is there a way to set the which of the home screens the phone goes to when you hit the home button?

View 4 Replies View Related

Motorola Droid X :: 2nd Click Of Home Button As Sleep Button?

Nov 2, 2010

I like being able to wake the phone to view the lock screen using the home button at the bottom of the phone, but is there any way to make it so that a second click of that button, or a click of one of the others down there, will make it sleep again? Having to press the power button up top is just an inconvenience.

View 5 Replies View Related

Sony Ericsson Xperia X10 : X10i - When Press Home Button - Get A Prompt To Select To Complete Action Using Home Or Timescape

Sep 16, 2010

I am a new member and a relatively new owner of an X10i. Overall I am happy with the phone but I am hoping some can answer a question. When I press the home button (middle one) I get a prompt to select to 'Complete Action using Home or Timescape' This is quite annoying. I want the default action to be Home (not Timescape) but despite ticking the box in the prompt it still pops up this box.

View 3 Replies View Related

HTC Magic :: Home Button & Call Button Not Working

Oct 20, 2009

this morning when I wake up I realized that:

- home button is not working
- call button is not working unless you're into the contacts application (doesn't work from home page)
- Astrid application has lost all of the TODO tasks.
- It doesn't asks for the unlock graphical code!

It lost all of its battery yesterday night while surfing on the browser. My phone is an HTC MAgic Vodafone, using Android 1.6 Any ideas on how should i proceed? I soft reset the phone already.

View 4 Replies View Related

Android : When Click On GDE And Click The Home Button - Switches Back To Stock Home Screen

Dec 19, 2009

When I DL'd the GDE app, I accidentally set my stock droid "HOME" screen as the default screen when the popup box came up asking me to choose between stock Home and GDE. Now when I click on GDE and click the home button, it switches back to the stock Home screen. How to I switch the settings now to set the GDE app as the new home screen?

View 15 Replies View Related

Android :: Android - Override Back Button To Act Like Home Button

Jan 4, 2010

On pressing the back button, I'd like my application to go into the stopped state, rather than the destroyed state. In the Android docs it states: not all activities have the behavior that they are destroyed when BACK is pressed. When the user starts playing music in the Music application and then presses BACK, the application overrides the normal back behavior, preventing the player activity from being destroyed, and continues playing music, even though its activity is no longer visible


How do I replicate this functionality in my own application? I think there must be three possibilities.

1) Capture the back button press (as below) and then call whatever method(s) the home button calls...........

View 2 Replies View Related







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