android-actionbar

Fragment disappears from backstack

為{幸葍}努か 提交于 2019-12-05 13:30:23
Why does FragmentTwo disappear from the backstack in the following situation: My app has a Fragment called FragmentOne in an Activity . FragmentOne holds a Button . When clicked, it launches FragmentTwo , which is added to the Fragment backstack. FragmentTwo has a Button , which when clicked adds two tabs to the ActionBar linked to two Fragments , FragmentThree and FragmentFour . FragmentThree is visible. If I now click the back button, I expected to see FragmentTwo . Instead, I see FragmentOne . Where did FragmentTwo go? Before I override onKeyDown() and start implementing my own backstack

How does action_bar_embed_tabs exactly work in Android?

穿精又带淫゛_ 提交于 2019-12-05 13:15:13
I have tabs in an actionbar. On large screens the tabs are embed to the actionbar but on small screens the are not. I want to control the tabs manual so i can separate the tabs from the actionbar. I tried to set abs__action_bar_embed_tabs but that didn't work <resources> <bool name="abs__action_bar_embed_tabs">false</bool> </resources> Atul O Holic I know this is an old post, however I would like to add a solution using action_bar_embed_tabs for future readers. Create the below method (do take care of the imports), public static void setHasEmbeddedTabs(Object inActionBar, final boolean

How to fix cut-off custom SearchView background in landscape?

不打扰是莪最后的温柔 提交于 2019-12-05 12:37:26
I've followed the great answer for this question to make the SearchView widget in my ActionBar fit a custom theme. It works just fine for portrait mode, but in landscape the OS will shrink the height of the ActionBar to maximize content screen estate. Instead of fitting the SearchView widget without margins into the ActionBar just like the other items, it is chopped off at the top: I've dug through the res-folder of the Android source, but could not find any specialized layouts or resources that would make obvious how to fix this or even how Android itself manages to fit the default Holo

Android ActionBar ActionProvider submenu

て烟熏妆下的殇ゞ 提交于 2019-12-05 12:12:04
I just can't get the ActionProvider to show a submenu and I don't undestand why. I have my menu defined in xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/dossier_menu" android:showAsAction="always" android:actionProviderClass="com.some.other.mockup.MActionProvider"> </item> </menu> action provider class: public class MActionProvider extends ActionProvider { private static final String TAG = "MActionProvider"; private static final int LIST_LENGTH = 3; private Context context; /** * Creates a new instance. * *

Android Device Chooser Shows Red X In Target Column

纵饮孤独 提交于 2019-12-05 12:11:59
问题 I've recently built an Android app with a minSdkVersion of 7 and targetSdkVersion of 10. I'm now making the app tablet compatible and adding action bars. So I updated by targetSdkVersion to 15 and in my project properties, moved my Project Build Tarket to Android 4.0.3, API 15. I also double-checked that my Java Compiler is 1.6. Without making any other changes to my code, I try to run my app and in the Android Device Chooser, my two physical devices, versions 2.3.4 and 3.1, both have a red X

Styling ActionBar Sherlock

岁酱吖の 提交于 2019-12-05 10:46:26
I'm trying to customize my sherlock action bar, but nothing that I code in my style.xml is recognized. In my manifest file: android:theme="@style/Theme.Sherlock" My style.xml: <resources> <style name="Theme.MyAppTheme" parent="Theme.Sherlock"> <item name="android:actionBarStyle">@style/Theme.MyAppTheme.ActionBar</item> </style> <style name="Theme.MyAppTheme.ActionBar" parent="Widget.Sherlock.ActionBar"> <item name="android:background">#222222</item> <item name="android:height">64dip</item> <item name="android:titleTextStyle">@style/Theme.MyAppTheme.ActionBar.TitleTextStyle</item> </style>

Can't get the Android 4.0 Split Action Bar working

醉酒当歌 提交于 2019-12-05 08:23:07
I've followed the development pages on the android dev site, but I cannot get my action bar to split to the top and bottom of the screen. I've got a menu xml defined with a couple of options: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/stop_services" android:icon="@drawable/ic_launcher" android:title="@string/stop" android:showAsAction="ifRoom|withText"/> <item android:id="@+id/start_services" android:icon="@drawable/pushpin" android:title="@string/start" android:showAsAction="ifRoom|withText"/> </menu> In my

Soft Keyboard Hiding ActionBar while using adjustPan

那年仲夏 提交于 2019-12-05 07:06:32
I need to set visible all these three items 1. ActionBar 2. ListView 3. EditText (at Bottom) When i click on EditText , it pushed the background image and squeezed it. i saw some tutorials and used android:windowSoftInputMode="adjustPan" that solved the squeezing issue but created a new one. When the SoftKeyboard appears, it also hides the ActionBar . I have visited many questions , but none of them was actually helpfull. IS there any way to set ActionBar always visible whatever happening on screen etc... EDITED The xml of fragment used to display the ListView and EditText is : <?xml version=

How to go to previous selected tab when pressing an activity action bar back button

浪子不回头ぞ 提交于 2019-12-05 06:36:20
I have six Tabs in MainActivity, the second tab have a listview, when user press on the listview item, its open a new Activity with Action bar, so, when user press on the back button of the second activity, I want to go to previous tab (second tab) of Main Activity, but its loading the First Tab (Home Tab). How I can resolve this problem? We have three cases here. The actual back button (regardless it is hardware or software), the Action Bar's parent ("Up") button, and both buttons: Back button case : When you call the SecondActivity , use startActivityForResult() to keep MainActivity informed

Actionbar like evernote - up button and tabs in one row on top with menu actions at bottom

一笑奈何 提交于 2019-12-05 06:33:26
问题 I have app which has actionbar containing 1) up button which opens side bar menu for navigation just like google plus 2) 2 action menu buttons 3) 2 tabs implemented via view pager I have successfully implementing actionbar using actionbarsherlock and the result is - > i want to implement something like evernote app where up button and tabs are in one row and action menu uses split actionbar . i have icons for tabs so fitting them with up button in one row is not an issue can someone please