android-actionbar-compat

Replace the action bar's title with a spinner (drop down)

荒凉一梦 提交于 2019-12-12 08:29:38
问题 I am trying to display a spinner in the same position where the action bar's default title appear. I followed the instruction of the similar SO case here , so I managed to eliminate the title but still the spinner's position is not aligned to the left, as you can see from this screen-shot Here are the main definitions of my application to reproduce this case: AndroidMenifest.xml: <application android:label="app" android:icon="@drawable/ic_launcher" android:theme="@style/Theme.AppCompat" > ...

Make ActionBar title uppercase

隐身守侯 提交于 2019-12-12 06:37:14
问题 How do I make the ActionBar title uppercase? Some answers suggest putting <item name="android:textAllCaps">true</item> but this has no effect when I put it in the actionBar style or actionBar's titleTextStyle . It only has an effect when I put in in the AppTheme style but that makes a bunch of things in my app also in all caps which I don't want. My styles: <style name="AppTheme" parent="AppBaseTheme"> <!-- snip snip --> <item name="android:actionBarStyle">@style/NewActionBar</item> </style>

findFragmentByTag() returns null only on the third tab of the ActioBar

自古美人都是妖i 提交于 2019-12-12 01:53:16
问题 I am using a tabbed Activity provided by Android with android.support.v7.app.ActionBar.TabListener , ViewPager and FragmentPagerAdapter . The parent Activty cointains and manages three Fragment . In addition, the parent Activity has a method to save the data provided by the fragments. In order to get the data defined in them (and not sended by the parent Activity) I am wrote the following code: MyFragment frag = (MyFragment) mSectionsPagerAdapter.getActiveFragment(mViewPager,1

ActionBarCompat and MapActivity

落爺英雄遲暮 提交于 2019-12-12 01:52:53
问题 I've successfully converted most of my app to use ActionBarCompat by extending ActionBarActivity on most activities, however... I have a MapActivity class and need this to work here as well. How would I go about creating a new class based on ActionBarActivity and having it extend MapActivity and would that even work? The sample that Google provides in the ../samples/android-17/ActionBarCompat directory has a lot of these java files (ActionBarActivity.java, etc.) but also tons of required

I have problems ActionBarDrawerToggle

我怕爱的太早我们不能终老 提交于 2019-12-11 20:24:01
问题 Recently I was using in my App this feature. But, using the ActionBarDrawerToggle a new app, I went unused error in that function. So I implemented import android.support.v7.app.ActionBarDrawerToggle; But now the code does not work for me. public class MainActivity extends ActionBarActivity { private ListView drawerList; private String[] drawerOptions; private DrawerLayout drawerLayout; private ActionBarDrawerToggle drawerToggle; private Fragment[] fragments = new Fragment[]{ new MainFragment

Bug in lib support V7 with startSupportActionMode

∥☆過路亽.° 提交于 2019-12-11 19:25:53
问题 In a ActionBarActivity (lib support V7), when i call startSupportActionMode() from my nexus 4 (4.3), in callback, i have a double call to onPrepareActionMode() because the onDestroyActionMode is also called. In other terms, the bug is: 1 > startSupportActionMode(callback); 2 > callback.onPrepareActionMode() is triggered 3 > callback.onDestroyActionMode() is triggered (not by me, not normal) 4 > callback.onPrepareActionMode() is triggered The good result must be: 1 > startSupportActionMode

getWindow().hasFeature() on API < 11

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 09:43:29
问题 I need to check if the overlay feature has been set on an ActionBarCompat instance. The getWindow().hasFeature() method is only available on API 11 and up. How can I check the feature on API < 11 ? EDIT: Based on the comment, the getFeatures method should be available from API 1 but it is protected scope and I need to access the feature from another class. The hasFeature method, the one I need to use, on the other hand is API 11 and above only. This is what Android Studio shows me and the app

Why the menu items appear on the optionsMenu?

喜欢而已 提交于 2019-12-11 08:59:11
问题 Despite there are some icons associated with certain action and have no enough space in the Actionbar , they appear in the optionsMenu instead of appearing in the overflow icon. I am inflating the actionBar with five icons each one has a specific functionality "Please refer to the XML file below", the items which have the android:showAsAction=never I expect them to implicitly reside inside the overflow icon on the actionBar , but when I run the App, any item with the property android

Android AppCompat Toolbar does not respond to touching action items

╄→гoц情女王★ 提交于 2019-12-11 04:17:45
问题 I'm following these instructions to implement an AppCompat Toolbar in my Android app. I am using AppCompat version 7:22.0.1 Also, I'm using this toolbar in addition to the actionBar (it's not replacing the ActionBar , as I see in many other examples). The toolbar shows up, and it even shows the icon I specificed, but it does not respond when I touch the icon. Has anyone had a similar problem with the AppCompat Toolbar ? Any suggestions on what to try next? Here's my code from my browse()

findFragmentByTag() is returning null when working with getSupportFragmentManager()

不问归期 提交于 2019-12-11 04:08:29
问题 I am working with the support library ActionBar because I'm using an older minimum SDK. In the activity, I am using FragmentTabHost because I have 3 tabs. The ActionBar also has a SearchView, so when a search is made, the 3rd tab is switched out with the results of the search. I am able to get intput from the SearchView, but I am unable to switch out the 3rd tab when I have a search result. I am using this as an example: Dynamically changing the fragments inside a fragment tab host? My