android-actionbar-compat

SearchView taking all the space in the new ActionBarCompat

不问归期 提交于 2019-11-28 07:33:42
I switched from ActionBarSherlock to ActionBarCompat (support library v7). After some adjustments, almost everything is working fine by now. But I'm in trouble with the SearchView in the ActionBar. When it's expanded (actually, It's always expanded in my Activity), it takes up all the space and doesn't respect the space of other Action Items that are set to show always (showAsAction="always"). To simulate the problem, use this: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_buscar" app

Menu items doesn't show up on the actionbar [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 06:16:13
This question already has an answer here: Actionbar not shown with AppCompat 3 answers I am using appcompat in my app. I want the menu items to show on actionbar or at least the overflow(3 dots) to show them when there is no room. There is lot of space on the actionbar, but still they don't show up. The menu flow raises from the bottom and that too only when menu button is pressed. menu_activity.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/menu_lang" android:showAsAction="always" android:title

ActionBarActivity closes after pressing hardware menu button. Without stack trace

限于喜欢 提交于 2019-11-28 05:50:12
问题 I have a really strange problem. When I use ActionBarActivity after clicking on hardware menu button (device with Android 2.3) the app closes unexpectedly without any particular error. Logcat gives only: W/KeyCharacterMap﹕ No keyboard for id 0 W/KeyCharacterMap﹕ Using default keymap: /system/usr/keychars/qwerty.kcm.bin 30-30/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 03-19 15:54:48.612 30-30/? I/DEBUG﹕ Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546

Android how to get AppCompat.Translucent type theme with support actionbar?

笑着哭i 提交于 2019-11-28 03:26:41
I would like to add the support actionbar to one of my activities, I previously had been using the theme.translucent with this activity but in order to make the support actionbar work I needed to inherit the Theme.AppCompat, I need to maintain a translucent theme in this activity but unfortunately there isnt a Theme.AppCompat.translucent that i can see by default, is there any way that this can be done? Cameron Ketcham You can create a new set of styles to use which have the same properties as Theme.Translucent from themes.xml . Add the following to your styles.xml file: <style name="Theme

Android: AppCompat 21, how to change the back icon and the overflow icon to a custom one?

谁说我不能喝 提交于 2019-11-28 03:10:18
问题 On my project until some days ago I used sherlock actionbar but I dicided to change the whole actionbar style to the new material design. On my old theme for the back and overflow icon I had some custom icons setted on my theme. But on the appcompat I tried define it on my theme where I use it on a toolbar but it's not working. Anyone knows how to make this possible? My theme where I use on the toolbar(Generated with asset studio): <style name="Theme.Themewiz" parent="@style/Theme.AppCompat

getSupportActionBar from inside of Fragment ActionBarCompat

回眸只為那壹抹淺笑 提交于 2019-11-28 03:07:35
I'm starting a new project that uses the AppCompat/ActionBarCompat in v7 support library. I'm trying to figure out how to use the getSupportActionBar from within a fragment. My activity that hosts the fragment extends ActionBarActivity , but I don't see a similar support class for Fragments. From within my fragment public class CrimeFragment extends Fragment { //... getActivity().getSupportActionBar().setSubtitle(R.string.subtitle); // getSupportActionBar is not defined in the v4 version of Fragment //... } The google page for using it ( http://android-developers.blogspot.in/2013/08

Android expanded SearchView makes other ActionBar items disappear

淺唱寂寞╮ 提交于 2019-11-28 01:27:48
问题 I'm facing some problems with a SearchView in a Contextual Action Bar called by a Fragment. The major one is that when my SearchView is expanded, it makes disappear all other items in action bar (except the closing button) even if there's some unused space, like you can see in this screenshot: Screenshot Furthermore, I'm also having the same exact problem discussed in this question: ActionBar always expanded SearchView with the icon inside This is the XML code of my SearchView: <?xml version=

getSupportActionBar() The method getSupportActionBar() is undefined for the type TaskActivity. Why?

ぃ、小莉子 提交于 2019-11-27 23:28:53
I was recommended to extend my Activity class from ActionBarActivity Here is the previous code: import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } I wrote new application and followed advice. import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; public class MainActivity extends ActionBarActivity { @Override

ActionBar 'up' button destroys parent activity, 'back' does not

孤者浪人 提交于 2019-11-27 20:03:41
问题 I have a relatively simple Android app with one Activity showing a list of items and another showing details of a selected item. I start the list activity, which is my topmost activity (using FLAG_ACTIVITY_CLEAR_TOP to clear the login activity from which this is called) with: Intent intent = new Intent(this, ListInstancesActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); and from within that activity I act on an item being selected with: Intent

Change ActionBar title text color using Light.DarkActionBar theme in AppCompat 21

我的未来我决定 提交于 2019-11-27 17:35:18
I'm using the v7 appcompat 21 library to use the new Material styles on pre-Lollipop devices. My styles.xml looks like this: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:textColorPrimary">#ff0000</item> <item name="android:textColorPrimaryInverse">#ff0000</item> </style> I am trying to change the text color on the action bar. But no matter what I put for textColorPrimary or textColorPrimaryInverse, the color is always white. If I inherit from Theme.AppCompat, I can override "textColorPrimary", and if I inherit from Theme.AppCompat.Light, I can