android-actionbar-compat
android title won’t show in toolbar
getSupportActionBar().setDisplayShowTitleEnabled(true);
Android toolbar menu is not showing
I was also facing the same problem, but the actual error was, i forgot to introduce toolbar in java activity under AppCompactActivity, under on create method define your toolbar by id and call setSupportActionBar(ToolBar); Example is below: public class secondActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); Toolbar toolbar = (Toolbar) … Read more
“You need to use a Theme.Appcompat theme…” when testing ActionBarActivity, but I am
There are 2 things I’d try: Remove the setTheme from onCreate, it is redundant with the manifest and may lead to confusion Set the theme at Application instead of Activity level in the manifest
How to enable homeAsUp or call setDisplayHomeAsUpEnabled() on standalone toolbar with appcompat v21
@Pedro Oliveira’s solution worked. I could even find the drawable that the AppCompat library uses (and therefore is already included in the apk). What more it’s also mirrored, so it works both for ltr, rtl locales: actionbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha); and this is it alltogether, with the correction from @VictorYakunin public class SettingsActivity extends PreferenceActivity { @Override protected … Read more
ActionBar ‘up’ button destroys parent activity, ‘back’ does not
In the android manifest.xml adding the following attribute for the parent activity tag worked for me. android:launchMode=”singleTop” Reference : http://developer.android.com/guide/topics/manifest/activity-element.html Refer the similar question: How can I return to a parent activity correctly?
Change ActionBar title text color using Light.DarkActionBar theme in AppCompat 21
You can change it with actionBarStyle attribute of theme. <style name=”AppBaseTheme” parent=”@style/Theme.AppCompat.Light.DarkActionBar”> <item name=”actionBarStyle”>@style/MyActionBar</item> </style> <style name=”MyActionBar” parent=”@style/Widget.AppCompat.ActionBar.Solid”> <item name=”titleTextStyle”>@style/MyTitleTextStyle</item> </style> <style name=”MyTitleTextStyle” parent=”@style/TextAppearance.AppCompat.Widget.ActionBar.Title”> <item name=”android:textColor”>CHANGE_COLOR_HERE</item> </style>
Android v7 Toolbar button alignment
You should add android:layout_gravity=”end” for your Button : <Button android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”end” android:id=”@+id/showevents” android:textSize=”12sp” android:background=”@null” android:layout_alignParentEnd=”true” android:layout_alignParentRight=”true” android:textColor=”#FFF” android:text=”UPCOMING \nEVENTS”/>