Handling back and home button differently

Go To StackoverFlow.com

0

I've got an app with two screens, we can call them List and Details.

If an user is at Details and presses Home to minimize the app and then switches back I want to stay in the view and just restore, but if he presses Back I want to go back to List, I figure I can save a "Done"-button this way. But...what's the proper way to do this?

Currently I've overriden onPause and onSaveInstance but it seems they're both called in both cases.

I'm thinking about overriding onKeyDown instead, like he did; How to control Activity flow - Back button versus Home button, but that doesn't seem like a "nice" way to do it so I thought I'd check if anybody else has another idea.

2012-04-03 19:37
by dutt


2

Make two activities, for list and for details. When you will press the back key in the details activity it will finish and will show up the list activity.

2012-04-03 19:41
by lexmiir
Ads