tags:

views:

35

answers:

1

I'm trying to implement tab buttons bar and a navigation bar in my android application. The problem is, that I would like the navigation elements to persist. When starting a child activity, the nav bar moves.

How can I make these two elements "non-movable"?

A: 

Add button bar and navigation bar to all your activities and share it's state via static fields. Remember to initialize bars when child activity starts and update parent's bars when child activity finishes (either via onResume or as a result of startActivityForResult).

It is not possible to share instances of UI elements between activities, as Activities are (by design) independent of each other.

Application cannot control how new activity is introduced - it can slide, zoom in or just show up if user disable animation in device preferences, UPDATE: it looks like since API Level 5 there are ways to override this, please refer to http://stackoverflow.com/questions/3389501/activity-transition-in-android . But if you really need to keep bars in place, use single Activity and replace main view content with animation you like.

tomash