Eclipse will not recognize project as library (ActionBarSherlock/ViewPagerIndicator)

Where to store the actual library project does not matter, as long as you use a relative link to reference it. Check out the Library Projects – Development considerations: Library project storage location There are no specific requirements on where you should store a library project, relative to a dependent application project, as long as … Read more

How do you turn off share history when using ShareActionProvider?

For me, the best solution for avoid the history icon is don’t use ShareActionProvider, instead of it, create it as any other action: <item android:id=”@+id/menu_action_share” android:showAsAction=”ifRoom” android:icon=”@drawable/ic_action_share” android:title=”@string/share”/> at the menu/activity_actions.xml put a item with the ic_action_share icon… @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_actions, menu); return super.onCreateOptionsMenu(menu); } Inflate the menu normally… private void … Read more

Hide/Show Action Bar Option Menu Item for different fragments

Try this… You don’t need to override onCreateOptionsMenu() in your Fragment class again. Menu items visibility can be changed by overriding onPrepareOptionsMenu() method available in Fragment class. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @Override public void onPrepareOptionsMenu(Menu menu) { menu.findItem(R.id.action_search).setVisible(false); super.onPrepareOptionsMenu(menu); }

Change ActionBarSherlock background color

The action bar background color is defined in a style for the action bar, not in the theme itself. You’ll need to do something like this: <style name=”Theme.MyTheme” parent=”Theme.Sherlock.ForceOverflow”> <item name=”actionBarStyle”>@style/Widget.MyTheme.ActionBar</item> <item name=”android:actionBarStyle”>@style/Widget.MyTheme.ActionBar</item> </style> <style name=”Widget.MyTheme.ActionBar” parent=”Widget.Sherlock.ActionBar”> <item name=”android:background”>#ff000000</item> <item name=”background”>#ff000000</item> </style> Be careful using colors defined in XML. ColorDrawable did not respect it’s view … Read more

Setting ActionBarSherlock Theme for Android app

Usually, you set your theme in the manifest, as shown in the Android developer documentation (and linked to from the ActionBarSherlock theming page). If you want to use ActionBarSherlock everywhere within your app, this works: <application android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/Theme.Sherlock”>