android-actionbar-compat

support.v7 ShareActionProvider crashes if showAsAction=“always”

女生的网名这么多〃 提交于 2021-02-07 20:24:04
问题 Trying to use ShareActionProvider from the support library (v7), my app works fine if I don't set the showAsAction attribute for the menu item. My intention is to display this menu item as an icon and not as an overflow item. If, however, I set it to show always, the app crashes with NullPointerException . 07-30 01:23:37.778: E/AndroidRuntime(25853): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageDrawable(android.graphics.drawable

Missing Up navigation icon after switching from ICS ActionBar to Lollipop Toolbar

蓝咒 提交于 2020-01-20 18:48:27
问题 I have an activity with many fragments that uses action bar and navigation drawer. It has "home as up" enabled. I have implemented proper logic that only top level fragments show action bar drawer toggle icon, other fragments show up arrow. I achieved this by: mDrawerToggle.setDrawerIndicatorEnabled(false); mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerList); Now old v4 support library ActionBarDrawerToggle became deprecated. I've switched to v7 version together

Use Tab with new ToolBar (AppCompat v7-21)

ぃ、小莉子 提交于 2020-01-18 04:10:27
问题 I was using SupportActionBar with tabs and a custom ActionBar theme (created with http://jgilfelt.github.io/android-actionbarstylegenerator/), that show the tabs only when the user expands the search view. public boolean onMenuItemActionExpand(MenuItem item) { actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); return true; } } I migrated from ActionBar to Toolbar. My app really needs to support API 9. Is there a way to use this code to add the tabs back?: Toolbar toolbar = (Toolbar)

Unable to start new Activity:android

折月煮酒 提交于 2020-01-17 04:23:06
问题 I have added a new activity through right clicking on app. New >Activity >Navigation Drawer Activity . http://i.stack.imgur.com/Pdtbo.png Now i am not able to start this activity from MainActivity . And getting following errors. Please help me. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.atlasmobile/com.app.atlasmobile.Pois_main}: android.view.InflateException: Binary XML file line #19: Error inflating class fragment at android.app.ActivityThread

Android: Icons don't appear in Action Bar

这一生的挚爱 提交于 2020-01-13 17:57:21
问题 I'm following the google tutorial for action bars but the icons don't appear on it, this is the menu xml file: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_refresh" android:icon="@drawable/ic_action_refresh" android:title="refresh" android:showAsAction="ifRoom"/> <item android:id="@+id/action_settings" android:icon="@drawable/ic_action_settings" android:title="settings" android

Android: Icons don't appear in Action Bar

和自甴很熟 提交于 2020-01-13 17:57:11
问题 I'm following the google tutorial for action bars but the icons don't appear on it, this is the menu xml file: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_refresh" android:icon="@drawable/ic_action_refresh" android:title="refresh" android:showAsAction="ifRoom"/> <item android:id="@+id/action_settings" android:icon="@drawable/ic_action_settings" android:title="settings" android

Change the title text color in the Android ActionBar via xml

♀尐吖头ヾ 提交于 2020-01-11 11:37:40
问题 I want to change the title text color of the ActionBar in my app. I have tried in many ways but I can't achieve it. I don't want to do it programatically because when the app is launched it shows the action bar with previous color and then changes to the new one. I'm supporting from Api Level 8 and my xml was generated with the Android Action Bar Style Generator. Then I tried to change the title text color with this . The title text color is still black. This is my code: <resources> <style

Change the title text color in the Android ActionBar via xml

拥有回忆 提交于 2020-01-11 11:37:06
问题 I want to change the title text color of the ActionBar in my app. I have tried in many ways but I can't achieve it. I don't want to do it programatically because when the app is launched it shows the action bar with previous color and then changes to the new one. I'm supporting from Api Level 8 and my xml was generated with the Android Action Bar Style Generator. Then I tried to change the title text color with this . The title text color is still black. This is my code: <resources> <style

The ActionMode is being created twice with the ActionBarCompat r18

半世苍凉 提交于 2020-01-07 00:07:40
问题 I found this bug and I posted it in the Android's Bug Tracker: https://code.google.com/p/android/issues/detail?id=58321 I'm creating this Q&A-style question to help those who are having the same problem. 回答1: If you have the same problem but you can't wait for this bug to be fixed, use the patched version I've created to solve this bug: https://github.com/CyberEagle/SupportLibraryV7AppCompatPatched 来源: https://stackoverflow.com/questions/17973528/the-actionmode-is-being-created-twice-with-the

The ActionMode is being created twice with the ActionBarCompat r18

假如想象 提交于 2020-01-07 00:06:14
问题 I found this bug and I posted it in the Android's Bug Tracker: https://code.google.com/p/android/issues/detail?id=58321 I'm creating this Q&A-style question to help those who are having the same problem. 回答1: If you have the same problem but you can't wait for this bug to be fixed, use the patched version I've created to solve this bug: https://github.com/CyberEagle/SupportLibraryV7AppCompatPatched 来源: https://stackoverflow.com/questions/17973528/the-actionmode-is-being-created-twice-with-the