Monday, November 29, 2010

[android-developers] Back key behaviour between Activity Groups.

Hello All,
My app is kind of a music app and I have a playback bar that I need to
be visible across all the views.

I had three activities, A/B/C. Instead of adding the playback bar
explicitly to all A,B,C. I added the Playback Bar to A and made A,B,C
as ActivityGroups.

Since, A has the playback bar, now I when I start B from A, I call
setContentView from A to show B.

The problem is, once I call setContentView to show B, and then if the
user presses back key in B, then it goes to home screen, instead of
coming to A.

I have seen some snippets on web, which maintain the view stack and
when user presses the back key they pop up the previous view.

I couldnt implement that.

Questions :
1) Is there any better way to having a activity like Playback bar/
Status bars across all the views/activities ?

2) If the above way is the only way to do it,then how can I handle the
back key?

With Regards
MS.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment