android-actionbar

no callback to onOptionsMenuClosed(). and getting error in overriding onPanelClosed() functions

拟墨画扇 提交于 2019-12-11 11:44:25
问题 I have a fragment which is made using PreferenceFragment ,where I am overriding onOptionsMenuClosed(). But , its the callback is not coming to it.Neither is the call back coming to OnMenuOpened(), OnPanelCosed()... This is what i have alredy tired. @Override public void onOptionsMenuClosed(Menu menu) { // TODO Auto-generated method stub Log.e(TAG, "close optionmenu"); super.onOptionsMenuClosed(menu); } and for onPanelClosed this is what i am trying. @Override public void onPanelClosed(int

Custom layout in toolbar not showing

依然范特西╮ 提交于 2019-12-11 11:16:35
问题 I have added supportActionbar to my app with toolBar using v7 support library. Now I need to show a custom layout on the actionbar which is simply a cart icon with a number badge. But when ever I try to put that, I get only a text button and no image is shown. My layout is: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="48dp" android:layout_height="fill_parent" android:layout_gravity="right" > <ImageView android:layout_width="wrap_content"

How to make Andorid's ActionBar/TabWidget LinearLayout to wrap it's children

↘锁芯ラ 提交于 2019-12-11 10:41:13
问题 I try to implement the scrollable tabs where each tab has it's size adjusted to it's content size. I tried two approaches: ActionBar and TabHost. In both cases I was able to adjust tabs sizes. To achieve that I setLayoutProperites on each Tab after given Tab was added. In both cases the same approach. The weight is changed to 0 and width is set to WRAP_CONTENT. Below the TabHost related example. LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabHost.getTabWidget()

Android: menu in action bar

夙愿已清 提交于 2019-12-11 10:39:13
问题 i have problem putting the menu there, in the upper right corner: android manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.mio.app" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="15" /> <application android:allowBackup="false" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Light">

Action bar buttons showing only in overflow (not extending ActionBarActivity)

只谈情不闲聊 提交于 2019-12-11 10:39:09
问题 I can only find solutions to this for the case of using the support library. Facts: build.gradle: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:design:22.2.0' } menu_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> <item android:id="@+id/ab_main_share" android:showAsAction="ifRoom|withText" android:title="Share" android:icon="@drawable/ic

Can't find action bar (Sherlock) inside root view

烂漫一生 提交于 2019-12-11 10:38:19
问题 I'm trying to find my activity's Action Bar's spinner so I can selectively show and hide it ( setNavigationMode does not work for my purposes). I tried this code, but the Action Bar doesn't appear to be in my activity's (which is an extension of SherlockFragmentActivity ) root view. private View findActionBarSpinner() { View rootView = findViewById(android.R.id.content).getRootView(); List<View> spinners = traverseViewChildren( (ViewGroup) rootView ); return findListNavigationSpinner(spinners

DialogFragment behaves differently when invoked via ActionBar

烈酒焚心 提交于 2019-12-11 10:27:37
问题 I'm experiencing strange, perhaps version-specific behavior with my DialogFragment subclass when testing the following steps: (1) Open the dialog (2) Leave the app with either the Home key or the Recent Apps key (3) Return to the app, and the dialog is no longer visible. It seems to be briefly, translucently visible behind the main activity. (4) Rotate the device, and the dialog re-appears. This bug occurs on my Asus TF700T pad running Android 4.2.1, and it does not occur on my Motorola Razr

ActionBarSherlock mirrod attributes — when to use “android:” prefix?

独自空忆成欢 提交于 2019-12-11 10:08:48
问题 When styling ActionBarSherlock I was wondering when I have to use the prefixed attribute, when the non-prefixed attribute, and when both. For example: <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> I found this explanation on the ActionBarSherlock website: Mirrored Attributes Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android

Stop onCreateOptionsMenu() to be called from detached Fragment

和自甴很熟 提交于 2019-12-11 10:02:13
问题 I know there is LOT of code but please read the first paragraph and go further if you need more info ! Thanks! I want to display contextual menu item in my 3 tabs activity (no view pager), just static tabs. The main activity is the ActionTab.listener. I used ActionBarActivity with action bar compat. The code for the main activity is below. I used the Google docs to attach and detach fragments (that are created if they are null the first time). Here is my LogCat, you can see that

Home button not shown when using the design support library

会有一股神秘感。 提交于 2019-12-11 09:38:27
问题 In my app, I'm displaying a Toolbar with the home button visible. In some screens this works as an up button, in others not. That works fine. Problem is that when importing the design support library, the home button is not shown in the toolbar. This happens just by importing it, not a single line of code changed. I'm importing it in Gradle with: compile 'com.android.support:design:22.2.0' Do I need to change something in code for the design library not to make the home button disappear? Is