0

When I navigate between activities using StartActivity the full screen including the Actionbar gets re drawn. What is the best way to keep the ActionBar on screen at all times and just update the title and menu.

My ActionBar is created in a BaseActivity which is passed in the correct title.

I have read through the documentation and can't find anything. Should I create the axtionbar in a fragment and add thet to the base to keep it from being totally redrawn?

Thanks

Dan
  • 1,450
  • 1
  • 17
  • 34

2 Answers2

2

I'm not sure if i understand your question, but if menus on ActionBar are different for each Activity, then i think that's normal.

However, maybe you refer to the transition between Activities (aka the animation when you navigate on your app) and for this you can create a Style:

<style name="noAnimTheme" parent="android:Theme">
   <item name="android:windowAnimationStyle">@null</item>
</style>

Then in your manifest file add this:

<activity android:name=".ui.ArticlesActivity" android:theme="@style/noAnimTheme">
    </activity>

Took this code from this answer.

Community
  • 1
  • 1
JJ86
  • 5,055
  • 2
  • 35
  • 64
  • 1
    @Dan as stated by ohter user's you can use Fragment, but prepare yourself to suffer martyrdom. – JJ86 Jul 11 '14 at 10:16
  • I have already experienced the nightmare that is fragments unfortunately. – Dan Jul 11 '14 at 10:38
0

When you navigate with StartActivity each time you show a whole new "page" or "screen". What you want to do is use an Fragments which replace only part of the activity.

There are plenty exaples on fragment using, even in Xamarin docs, here are complete guide how to use them http://developer.xamarin.com/guides/android/platform_features/fragments/

xakpc
  • 1,709
  • 13
  • 27