android-actionbar-compat

Change the title text color in the Android ActionBar via xml

跟風遠走 提交于 2019-12-02 05:43:59
I want to change the title text color of the ActionBar in my app. I have tried in many ways but I can't achieve it. I don't want to do it programatically because when the app is launched it shows the action bar with previous color and then changes to the new one. I'm supporting from Api Level 8 and my xml was generated with the Android Action Bar Style Generator . Then I tried to change the title text color with this . The title text color is still black. This is my code: <resources> <style name="Theme.Dbtools_style" parent="@style/Theme.AppCompat.Light"> <item name="actionBarItemBackground">

ActionBarActivity & ActivityUnitTest - NameNotFoundException

懵懂的女人 提交于 2019-12-02 02:44:46
问题 Ok...it is more likely to be my fault ;) When I do: public class XmlLifecycleTests extends ActivityUnitTestCase<Main> { ... (not in setUp) Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setPackage(APP_PACKAGE); intent.setClassName(APP_PACKAGE, ".gui.Main"); startActivity(intent, null, null); I get: java.lang.IllegalArgumentException: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{ar.android.app.gui/ar.android.app

Action Bar detect back button click in fragment

喜夏-厌秋 提交于 2019-12-02 00:25:16
I have a Fragment with action bar back button enabled in it. Code : @Override public void onAttach(Activity activity) { super.onAttach(activity); setHasOptionsMenu(true); actionBar = ((MainActivity)getActivity()).getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setCustomView(R.layout.custom_action_bar); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mInflater = (LayoutInflater) getActivity().getSystemService

Android Custom ActionBar with Search View

做~自己de王妃 提交于 2019-12-01 12:19:06
问题 I am using custom ActionBar library in my Android App. there i want to show a searchView but can not find any solution, i m working in library that is https://github.com/johannilsson/android-actionbar This is a class private class ExampleAction extends AbstractAction { public ExampleAction() { super(R.drawable.ic_title_export_default); } @Override public void performAction(View view) { Toast.makeText(OtherActivity.this, "Example action", Toast.LENGTH_SHORT).show(); } } //use for signle action

ActionBarActivity - NoClassDefFoundError exception

假装没事ソ 提交于 2019-12-01 10:12:22
Already seen: NoClassDefFoundError Android with ActionBarActivity and ActionBarActivity catch an error on Phone I am trying to use ActionBarCompact in my project. I have linked android-support-v7 project as well as its jar in my project following and checking the steps from lots of sources, but still I am unable to deal with the problem. When I built my project, there is no error, but there is exception at runtime. Don't know why class is not detected. Please tell me what is wrong. Thanks. Code: import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app

Customizing Up/Back/Burger background in my ActionBar

折月煮酒 提交于 2019-12-01 09:08:34
问题 I'm trying to customize the background of my action bar items with a selector, to override what is shown when the button is pressed. This was pretty easy with menu buttons (e.g., overflow icon), as you can style them with actionBarItemBackground . Sadly this does not apply for the up/home/left indicator. I have unsuccessfully tried, in my styles.xml: <item name="actionButtonStyle"> ; <item name="actionBarStyle"> ; <item name="toolbarStyle"> ; None of the nested attributes seem to act on the

Is there a way to implement actionbar to the activity that extends youtubebaseactivity [closed]

徘徊边缘 提交于 2019-12-01 05:37:14
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I have an activity that extends youtubebaseActivity for playing youtube videos. i would like to have an actionbar in this activity. Is there a way to implement it? 回答1: YouTubePlayerFragment is designed so you can play YouTube videos and use any Activity class (such as

android title won't show in toolbar

佐手、 提交于 2019-12-01 02:06:21
I have an xml that I use with so many activities with fragments file but my problem is that I can't display the text I want in the toolbar, I use that xml that way because I have a navigation drawer and I needed to handle somethings so I had to do it that way. my xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".StatusActivity" android:orientation="vertical" > <android.support.v7.widget.Toolbar

Android center custom view in actionbar

ⅰ亾dé卋堺 提交于 2019-11-30 20:22:04
Trying to set a custom view for my actionbar, but have the problem that it doesn't fill up the entire width of the actionbar which makes it har for me to center objects. How can i set a custom view in my actionbar that fills up the entire actionbar? Code for setting up my actionbar: actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayShowTitleEnabled(false); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); actionBar.setCustomView(inflater.inflate(R.layout.actionbar_layout, null)); And my

Android custom option menu item

喜欢而已 提交于 2019-11-30 17:50:16
问题 everyone! I have question for Android guys. Any help or suggestion will be appreciated. So my problem: I have application with ActionBarCompat and in this action bar I have a lot of different hiden menu items, which appear only if user click on menu button at action bar. Also I have couple menu items at action bar, which always visible. I need some customization for one of visible menu item. When user click on this menu item (let's say it would be "Add new" menu item), I need to show