android-actionbar

Android Action Bar tabs - inner fragment transaction issues

时光怂恿深爱的人放手 提交于 2019-12-04 13:11:56
问题 I have successfully set up tabs in the Action Bar using the following example from Google themselves at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentTabs.html as a bases. My code looks like so: public class Main extends SherlockFragmentActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setNavigationMode(ActionBar

Dynamically add action item in action bar

一曲冷凌霜 提交于 2019-12-04 12:49:27
I want to create my action menu items in the ActionBar totally dinamically for some reasons. But when I add the menu items from code, they are displayed as overflow of the setting menu item. Below there is my code. any solution? @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //getMenuInflater().inflate(R.menu.start, menu); MenuItem logoutMI= menu.add(0,1,0,"Logout"); logoutMI.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); logoutMI.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT); MenuItem configMI= menu.add

Android fullscreen activity with action bar

為{幸葍}努か 提交于 2019-12-04 12:15:15
what theme should I use to hide the notification bar but show the action bar? (Like calculator on Samsung phones) getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Use this with Theme holo **you have to do it through coding add this before setContentView() ** 来源: https://stackoverflow.com/questions/27313117/android-fullscreen-activity-with-action-bar

Android ActionBar (ActionBarCompat) Spinner Dropdown list ?

蓝咒 提交于 2019-12-04 12:10:55
问题 I am currently working ActionBar (ActionBarCompat) oriented project, I Need some Clarification about actionbar. I am using spinner layout like this, <Spinner android:id="@+id/SpinnerList" android:layout_width="fill_parent" android:layout_height="wrap_content" /> My code, public class MainActivity extends ActionBarActivity implements OnItemSelectedListener{ private boolean mAlternateTitle = false; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Change ActionMode Overflow icon

拜拜、爱过 提交于 2019-12-04 12:00:00
问题 Is there a way to change the ActionMode Overflow icon without changing the icon for the "normal" ActionBar? 回答1: I still need to figure out how to only change the Overflow-Icon inside of the ActionMode-Actionbar as I changed my Overflow-Icon in the default-Actionbar which is not visible in the ActionMode-Actionbar (and no, I don't want to change the background of my ActionMode-Actionbar!) Okay. Let's start with defining some styles. I will try and explain why we are defining them in this

Custom views in actionbar

无人久伴 提交于 2019-12-04 11:17:53
I have an action bar. One of the items in the actionbar is for notifications. I want to add a little icon in the top right of the actionbar item which represents how many notifications the user currently has. I went ahead and made a custom layout for the action bar item. Went to go add it and to my surprise there is no way for me to add a custom view as a button on a Action bar. I am using Actionbar-Sherlock for compatibility to older device. This is what I am going for: Paul Burke You're looking for ActionProvider . Here you can supply your own views and listeners. Check out the ABS demo,

ActionBar not working when extending ListActivity

∥☆過路亽.° 提交于 2019-12-04 11:08:15
问题 I have a confusing problem. I have a MainActivity with 2 actions : Update and Logout. The problem is when I run the activity that extends ListActivity the action bar doesn't appear . Below I have 2 images with 2 different extend types in MainActivity Extending ActionBarActivity example public class MainActivity extends ActionBarActivity By extends ListActivity the result is the same as in the picture below. Basically I want to make the main activity with a ListView and an a ction bar so that

Changing default text colour and still showing disabled menu items in different colour

浪子不回头ぞ 提交于 2019-12-04 10:56:23
With Theme.Holo.Light as the base theme, a designer noticed that the default text colour is not black, but a dark grey ( #505050 ). We'd like to change it to black. Looking for a simple way to change the default to black everywhere in the app, I found that this works: <resources> <style name="MyAppTheme" parent="android:Theme.Holo.Light"> <item name="android:textColor">@android:color/black</item> </style> </resources> Now, problem is , that also changes the colour of disabled items in Action Bar's overflow menu. How to override default text colour while still having disabled menu items look

Using support action bar home enabled

大兔子大兔子 提交于 2019-12-04 10:51:47
问题 I've just modified our code to use the new SupportActionBar provided in the v7-appcompat library but when running the code on a Jellybean phone (presumably the same problem exists for Honeycomb and Ice Cream Sandwich) the home button doesn't ever seem to be activated. Calling getSupportActionBar().setHomeButtonEnabled(true); doesn't seem to do what it says but works for Gingerbread phones. If I replace it with getActionBar().setHomeButtonEnabled(true) it does work. The theme that I use for

Method call mActionBar=getActionBar() gives error [closed]

我们两清 提交于 2019-12-04 10:44:19
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using support library android.support.v7.app.actionbar because i want action bar in api level 8 and above But following sentence gives me error like change mActionBar to ActionBar mActionBar=getActionBar(); My FragmentActivity in which I wnat to use ActionBar Tab is as follows import com.example.bottomtabadapter.TabPageAdapter; import android.os.Bundle; import android.support.v7.app.ActionBar;