android-actionbar

getSupportActionBar returns null

回眸只為那壹抹淺笑 提交于 2020-01-05 03:32:15
问题 I'm trying to use the ActionBarSherlock library for using Action Bar in older devices. My application run on Android(4.2-Real device) . But, when I tried it to open in my older galaxy tab which ran on Android 2.3.4 it crashes. This is what I found from logcat and here is the code of General Activity TextView text; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_general); /

Custom overflow icon is too big (Using android.support.v7 and AppCompat)

徘徊边缘 提交于 2020-01-05 02:48:33
问题 My goal is to have the action bar be a red color, but since my only options from the default android library were white and black, I tried customizing it. I made some custom red icons by using a paint bucket on gimp to just fill in the white icons and re-save it under a different name. I did the same thing with the overflow icon, but for some reason, it's rendering a lot bigger than my other icons, which I don't want. I am using android:minSdkVersion="15" and targetSdkVersion 21 and the

Icon's priority on action bar (keeping order of items)

人盡茶涼 提交于 2020-01-05 01:09:07
问题 I'm trying to control which action bar items get shown if there is limited space, and have tried the solution in this question and answer: Icons priority on action bar Everything works fine other than I want to keep the order of the icons in a manner which is different to the priority, whereas the solution above causes the items to be reordered. Is there any way to set a priority for item display, without altering the order that items appear in the actionbar? I've tried altering the order of

Remove Action bar Icon with custom view and show home up button

霸气de小男生 提交于 2020-01-04 14:36:34
问题 I am able to add custom view in actionbar . My application is supporting from version 2.3 so I had used ActionbarActivity . Now my query is to remove app icon from the actionbar and only to have home up icon i.e back image. I had tried lots of option that I found while searching. But its not working with custom view. edit ActionBar actionBar = getSupportActionBar(); LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL

Unable to get reference of the items in the Custom ActionBar

房东的猫 提交于 2020-01-04 09:56:50
问题 I am using a RelativeLayout with some items like EditTexts, Buttons to set a Custom ActionBar view. The problem is that I am unable to get the references of the items which are there in that custom view. Here is the custom view for ActionBar <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/actionbar_background" android:gravity="fill_horizontal|center_horizontal" >

Unable to get reference of the items in the Custom ActionBar

有些话、适合烂在心里 提交于 2020-01-04 09:55:50
问题 I am using a RelativeLayout with some items like EditTexts, Buttons to set a Custom ActionBar view. The problem is that I am unable to get the references of the items which are there in that custom view. Here is the custom view for ActionBar <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/actionbar_background" android:gravity="fill_horizontal|center_horizontal" >

ActionBar Dynamic Tab Text Color Change

梦想与她 提交于 2020-01-04 09:55:41
问题 I need to change the tab text color dynamically. When the tab is selected text should be yellow and when unselected it should be black. I tried some tricks, but all I achieved was to change the ActionBar title color... My Java code setting up the tabs: private void setSortTabs() { //getting the action bar from the MainActivity final ActionBar actionBar = ((ActionBarActivity) getActivity()).getSupportActionBar(); //adding tabs to the action bar actionBar.setNavigationMode(ActionBar.NAVIGATION

Action Bar not updated when updating language

戏子无情 提交于 2020-01-04 09:17:24
问题 I am currently building an app where I allow people updating the language within the application. But when changing the locale, all strings get updated but not the one in the action bar (corresponding to the activity name in the manifest). The language change is only taken into consideration when the app is restarted from scratch. What would be the best way to get all action bars updated without forcing an app reboot ? Thanks in advance for your time and help on this one. Cheers, Benjamin 来源:

Error inflating class com.android.internal.widget.ActionBarContainer

狂风中的少年 提交于 2020-01-04 05:34:07
问题 So, recently I had to move my project from where it was due to the Error: File path too long on windows, keep below 240 characters. After moving, and solving other errors when I run my project, the app crashes with android.view.InflateException: Binary XML file line #31: Error inflating class com.android.internal.widget.ActionBarContainer . Unfortunately, I cannot post the logcat message as it is too big to post, so I will just put some Caused by messages here. Apart from the inflate

Can't change the color of toolbar

烂漫一生 提交于 2020-01-04 04:06:08
问题 Can anyone please, explain me, why my toolbar doesn't change its color even though I created another style like: <style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">false</item> </style> added it in my manifest file like: <activity android:name=".SettingsActivity" android:label="@string/title_activity_settings" android:parentActivityName=".MainActivity"> <meta-data android:theme="@style/AppTheme.NoActionBar" android:name="android.support