Tag: android-actionbar

invalidateOptionsMenu doesnt get called from fragment

I have a fragment with that needs to build its own action bar : public class CalendarFragment extends Fragment { public CalendarFragment() { } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getActivity().supportInvalidateOptionsMenu(); setHasOptionsMenu(true); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.calendar_menu1, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { return super.onOptionsItemSelected(item); } @Override […]

When does onCreateOptionsMenu happen in an ActionBar enabled activity?

I know the menu item will be set as action icons in the ActionBar. I want to know exactly this onCreateOptionsMenu function, when does it called in the activity lifecycle. From my test, it does not even after onResume

Dot (.) instead of Swipe tab

i am implementing view pager and i want to put dot(.) in the bottom instead of swipe tab. how can i do that.Thanks for help Instead of this i want to do like this

Android ActionBar custom layout styling

I’m just starting android development coming from IOS and again stubbled onto a problem. And after 1 day of trying i decided that i will ask the people of stack overflow. So my problem: I have an app and in the action bar (default no sherlock) i want 1 logo and 2 lines of text. […]

Actionbar list navigation width – wrap content

By default in actionbar list navigation width of selected item is as wide as widest item. I would like to “wrap_content” in selected item as it’s in google+,gmail,maps android apps. Does someone know hot to do it? I tried to override getView of navigation adapter but it doesn’t work. It looks that this view is […]

Put switch inside action bar on Android

I’m working on a project where I am currently trying to put a switch inside the applications action bar (as in the wi-fi settings : http://tinypic.com/r/2l8vt35/6 ) How can this be done?

Android: How to/Tutorial for changing ActionBar to ActionBarCompat (Toolbar)?

I’ve been stuck on this, checked the official guidance, etc. Any tutorials/what are the steps to change from ActionBar to ActionBarCompat (for the Toolbar and support of older versions? I’ve imported appcompat-v7:21.0.+, tried getSupportActionBar(); and Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar); setSupportActionBar(toolbar); changed theme to appcompat theme in styles… Any common errors to note or ideas? […]

Keep Action Bar Stable during Activity Transition Animation

I am using the Action Bar in my Android application, and i am using sliding animation during activity transition, by calling: startActivityForResult(i, ALL_OK); overridePendingTransition(R.anim.slide_in, R.anim.slide_out); where in my xml files i have the following code: <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:fromXDelta=”100%p” android:toXDelta=”0″ android:duration=”400″/> </set> and <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:fromXDelta=”0″ android:toXDelta=”-100%p” android:duration=”400″/> </set> The animation is executed successfully, […]

How can I add my spinner to the ActionBar?

I’m trying to get my spinner working as the Action Bar Drop Down List item, but I cant seem to implement it at all, there aren’t many tutorials for this after searching through Google. I think its something to do with the .setListNavigationCallbacks(); line of code, I just have no idea how to get this […]

(ActionBar) Tabs + Pager + detail Fragments inside ViewPager container

For ActionBarSherlock I would like to have (Action Bar) Tabs + Pager. I use Fragments inside that pager container. I already got the examples of http://actionbarsherlock.com/ working, but I can’t manage to get a details fragment inside that pager container when I would click on let’s say a listitem in the first fragment. Is it […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.