Android menu item text color programmatically

android menu item text color programmatically First, define everything about the font that you want to use in a resources file. In this article we are creating an application in which user inputs items to a Spinner widget via an EditText widget. Still, the title color remains black. Android Option Menu Example. id. In my navigation drawer I have different items with different text colors. Android’s has normal (dark) and light themes, though it’s actually the light themes which are normally show in examples of the new Material design. In this post, we are going to talk about using custom views as menu items. setTextSize(20). DarkActionBar, then you need to set custom actionBarWidgetTheme in order to get action menu style changed. Home > Android > Android Vertical ScrollBar Styling. Overview. When you want to cross out a test in android, you are achieve it programmatically or through xml layout file. setBackgroundColor(), snack. For this, go to Solution Explorer -> Project Name ->Resources ->values. is room to seem some of the items with their text. Basically items are grouped inside the list much like giving a category heading to a bunch of similar items and then group them by the category headings. Pro tip: Use a custom layout to badge Android's action bar menu items Developer William J. All action buttons and other items available in the action overflow are defined in an XML menu resource. simple_spinner_item, languages An image to be used as the menu item icon. Android change background color of spinner Archive the background color of selected spinner list item You can use styling 1 Android change background For more clarity you can download the example for “Android Messaging Example for Sending SMS Programmatically” from buttom of this post. All answered can't. Android Option Menus are the primary menus of android. Once you understand the fundamentals of how to write an android app, the next logical step is to create a simple android app that has some menu items. android. Creating Android Sliding Sidebar (Hamburger) Menu with Navigation Drawer Icon By now most of us are familiar with Navigation Drawers as they’ve been in use by Facebook, Gmail, Google Play Music, Google Play Music and tons of others apps. There's a lot of potential for frustration. POPUP MENU CREATION. Here we will change button text color for different states. FileMenu. Set custom spinner inside font family color. I'm trying to change the background color and text color of the overflow menu with limited success. How can i do it? View 6 Replies View Related android - How to blink TextView text textColor="@android:color/black" android:text="This text will be blink\nafter clicking the button. Android question. xml Android Bottom Navigation View Tutorial With Example itemTextColor — Use this attribute to set the text color of the item in import android. How to change Spinner text color in Android. The Android framework does a lot to help us create and interact with menu action items, those little icons on the right side of the toolbar. This tutorial will explain in detail how the Android menu works along with the code snippets. internal. In ListView control, this feature is built in with a method call but when it comes to RecycleView, you have to implement it by yourself. The style attribute for the menu background is android anelFullBackground. #380 The background and text color in the menu couldn’t be changed using themes and styles. but I want the menu items to be spanned, occupying Is it possible to set the color of just span of text in a This android tip is about learning how to strike through or cross out in text in android. text color in Change menu item background color and text color: Android; Hide/unhide app icon programmatically :Android. Set/Change Action Bar title text size in android programmatically. Long-Press Menu Text Color (not the Menu Button "bottom popup menu") i'm having a hell of a time finding the necessary XML edits to change the text This is an efficient way to make button color change on Android Buttons can change color when a state changed (e. Using the setOnItemSelectedListener() method of Spinner you can assign a listener exposing the selected TextView. May be a color value, android:iconTintMode. view. android. Some of the most important ones are the id for the item and the title tag, which determines the text shown on the menu item. Holo in my app. 4 is causing the font to not work properly, but it’s Android Custom Spinner Dropdown Example Programmatically. More than 28 million people use GitHub to discover, fork, and contribute to over 85 million projects. Grokking Android Getting Down to the Nitty Gritty of Android Development menu items will be displayed in the ActionBar. simpleButton); simpleButton. This can be changed in theme, which you apply to activity in manifest. Menu How do we change the background color of Android options menu? color based on the state of the menu item. Android example of how to programmatically instantiate a View with a custom style. This is a short tutorial on how to create a menu item (button) in an Android ActionBar. You can create and initialize a Spinner from a XML string array or an ArrayList. Author on Google Plus. Change spinner text size in android programmatically. Android Changing text color of a MenuItem programmatically (Android) Raw. On click of A deeper look at the new quick settings menu in Android Lollipop putting what Google thinks are most important items up front. Blending mode used to apply the icon tint. Changing text color of menu item in navigation drawer I'm trying to add a night theme for my app and I've wasted nearly three hours just trying to make the text and icons in my navigation drawer turn white along with the dark background. Spinner" tells Android system that the item of the menu is a Spinner. Change listview item text size in android programmatically textview. but I want the menu items to be spanned, occupying Is it possible to set the color of just span of text in a and How can i change an application icon programmatically in Android?. In working on various features of this app, I’ve had more than a few problems to work through, since this project is one of my first on Android and I’ve never used many of the Android features that I’m now using. ForeColor = Color. Menu. attribute value contains the title of the menu item; android: how to change How can I change the action bar overflow menu background color in an Android activity Java code? How can I change the background color and text color and size of changing menu item programmatically is not working in android: Since you did not provide any other code, I can't say much about it. If i create an Options menu with menu. Light. if you want every item of the Spinner to show both You can easily add awesome animated context menu to your app. Android App Development: How to Create an Options Menu and at adding a menu item programmatically. I have customized my theme using following Style. The above screenshot shows the menu item color changes when its pressed. java MenuItem settingsMenuItem = menu. You can set the initial state and then the user can change it. Increase-decrease action title bar title text font size dynamically in android. I couldn’t get an Android ActionBar menu item icon to appear in the action bar until I followed the XML namespace example shown in the image (which comes from this url). Dynamically adding custom radio buttons in Android. Value of this attribute must be a resource, for example - @android:color/white , not a color value as #ffffff android - How to use CheckBox in Options Menu How to set selected item of Spinner programmatically in Android. action_settings); 2 hours ago · I am using a BottomNavigationDrawer/BottomSheetDialog from the following example, but I am unable to set the text and background color for the selected item in my This file is the linear layout responsible for placement of the gray bar that separates the menu from the rest of your app, the menu background color (or image if you like), and finally the table which will hold the view for individual menu items. An ActionBar is located at the top of an activity and it can display any number of status or navigation related elements such as title, icon, buttons, or arbitrary action-related views. Light on Dark and Dark on Light. findItem(R. My menu_selector. pressed, disabled, highlighted). 6 Responses to Changing background color and border color of an EditText widget using State List in Android Ryan on September 3, 2012 at 7:02 pm Thanks for your article Android :: Menu Item Separetor (menu Item In Different Line) Using requestFocus programmatically does not work. Participate in discussions with other Treehouse members and learn. action_settings); Android TextView span full width programmatically. The new componenets are navigation view view, TextInputLayout for floating labels for editing text, a floating action button, snackbar, tabs, coordinatorLayout, AppBarLayout & Collapsing Toolbars. setTextColor() and setActionTextColor() respectively. But, it requires some efforts to draw each state. Notice the parent attribute in the <style> element. Francis shares his straightforward solution for badging inside an app on an Android action bar icon. Android FAQ: How do I programmatically set the font size (and/or font style) for an Android TextView? Solution: Setting the Android TextView font size programmatically is a simple two-step process. How to style the ActionBar SearchView programmatically Nacho Lopez in android , actionbar , searchview , code read Nacho Lopez Change listview item text size in android programmatically. I am trying to overwrite the default backgroud In this tutorial you will learn about using Android options menu, how you can add items to Android options menu (using android oncreateoptionsmenu), how to c CollapsingToolbarLayout is the newly introduced in Lollipop. The Options Menu, Popup Menu, and Sliding Menu/Flyout Menu. Android actionbar, android, custom, font, toolbar, typeface Previous Article Add border to RelativeLayout(or any view) in Android Next Article Draw line on Canvas in Android Adding a radio button programmatically /* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2. and How can i change an application icon programmatically in Android?. CheckBoxList change BackGround color programmatically ASPNET WEBFORM Part 35 How to set an item selected when an asp net mvc HOW TO CHANGE TEXT AND BACKGROUND COLOR IN ANDROID This is an efficient way to make button color change on Android Buttons can change color when a state changed (e. How to Create Android Menus Android Custom ListView with Image and Text Related Posts. Whenever user scrolls up, this control will provide animating effect. In my fast Android browser app I update the menu item text like this: homePageMenuItem. Apps, ROMs, Customization. Dynamically change the list view background color after start app on button click event. To make this example very simple, we will take one Android Activity. Text colors are a little trickier as there is a new emphasis on using percentages of color to give you your final color value. The items in a menu can be declared within an XML file, which is then inflated and displayed to the user on demand. but cant to the text color. #380 Android Action Bar from the Options Menu. Right click and Add ->New Item. Change spinner text color in android programmatically. I have written the styles for the action bar as described in the video. Name color in Android? // Change specific items text color here } } } public class NavigationShader : ShapeDrawable. It should obey the themes though, so with android in your theme if you override android theme items, it should listen This short tutorial shows how to get Android menu item icons to show ActionBar menu item icons to show (without compatibility libraries) only as text in the Android Action Bar from the Options Menu. Can I change the background color of a Menu item in Android? Please let me know if anyone have any solution to this. Android Action Bar Menu Example Tutorial. xml How to change Spinner text color in Android. If you have ever had to gradually change the colour of a button, image or drawable asset in your application from say This short tutorial shows how to get Android menu item icons to show menu item icons to show (without compatibility libraries) only as text in the overflow Use the below code to set the checked property to true programmatically. - AndroidManifest. android - Highlight text in a TextView condensed" android:textColor="@android:color/black" android:text="Click the button to highlight the TextView specific text I have a problem with changing ListView SelectedItem's text color using Android styles. changing menu item programmatically is not working in android: Since you did not provide any other code, I can't say much about it. Create and modify ListView with different item value text color using #color code. The last option will be obviously to customize it but is there any way for changing the text color without customizing it. Android — Adding badge or count to the navigation drawer. with text in Overflow Menu Items: like How to change Menu Item text Color of holo theme in Android? Android: I am using Theme. How to set Text View color, size and text by programmatically in android studio Unity UI - Scroll Menu Pt 2: Vertical List - A scrolling, vertical list of buttons. The design guidelines say to choose a text color that is 87% or the selected color. menu control click outside to item text. That's it! We have successfully changed the background color and text color of Android options menu. i have used different menu items,which include Close menu. Android CIO Internet FileMenu. Next month we'll look at contextual menus for individual items Important Note: We can set color or image in the background of RelativeLayout in XML using background attribute or programmatically means in java class using setBackgroundColor() for color and setBackground() method for setting image. android: text = "@ color of spinner 1 Android change spinner item highlight color 1 Android Android Question spinner dropdown box background and text the item-color of the drop-down menu, not the spinner text color. So textview text become the Styling the Android Action Bar title using a custom typeface It’s possible that some change in Android 4. Button simpleButton=(Button) findViewById(R. Android :: Send A MessageBox When Select A Menu Item? Android :: Unable To Select Children (textview) Of TableRow Programmatically / Fix It? Android :: Listadapter - When Select An Item Random Other Items Background Also Gets Changed I would like to change background color (and text color) of each item of my ListView on focus (and, if possibile on selection). Here, we are going to see two examples of option menus. The android source code (data\res\layout\icon_menu_item_layout. redColor); Actually I'm trying to create a list of items with a Android :: Send A MessageBox When Select A Menu Item? Android :: Unable To Select Children (textview) Of TableRow Programmatically / Fix It? Android :: Listadapter - When Select An Item Random Other Items Background Also Gets Changed You want to add a badge to your cart icon to show the number of items. Step 5: Now, create another xml file as options_popup. VISIBLE) when set invisible in menu resource. As with all menus, you have a callback just before the list of actionable items are presented. Programmatically clicking a menu item in c#. For example, I put The style attribute for the menu background is android anelFullBackground. xml, can I change the menu buttons' standard text size, color etc using xml? Change the tooltip text associated with this menu item. MantasCode This entry was posted in Android on 10/13/2011 by How to programmatically click ActionBar Option Menu item ignores setVisibility(View. To recap, the Context Menu is a floating list of menu items that appears when a user Context Menu Android Tutorial - DZone Android SimpleCursorAdapter alternate Row Color example To change the background color of a row in ListView you have to use a custom Adapter. In order to save the menu open/closed state, you must define an id to the FabSpeedDial, otherwise if you rotate the device the state won't be persisted. Change ToolbarItem. When you apply the textSize to a Spinner, like so: The name attribute in the item can refer to a standard string, a hex color value, or a reference to any other resource type. Change listview item text size in android programmatically. 0 (the "License POPUP MENU CREATION. Add background color to all spinner items so they look different. Change ListView's Item Text Color. attribute value contains the title of the menu item; android: how to change How To Change Color Of Spinner Selected Item In Android December 5, 2015 by blogmeister · 0 Comments Share the post "How To Change Color Of Spinner Selected Item In Android" Android code: Change button background color and text color on click Android java: How to create Android responsive image background button How to add blur effect to background image in Android programmatically Change menu item background color and text color: Android; Contextual action menu usage with list items: Android; Remove app from recent apps programmatically Android: Setting Background Color of the Selected Item in ListView! how close the item's text is to the left side via android:paddingLeft, etc. New to Xamarin and Android Dev. FORUMS. You can provide a context menu for any view, but they are most often used for items in a ListView, GridView, or other view collections in which the user can perform direct actions on each item. that you always define android:title for each menu item, even if Menu Styling Views on Android (Without Going Crazy) 19 November 2014 on android. fullDark">@android: color/black</item> for example you won’t be able to change the color of the divider programmatically! Creating Android button with image and text using relative layout by Goran Siric on Monday, October 3, 2011 7:06 AM If you just want to create basic button with image and text on it, you can use standard android button control and one of the following properties: drawableLeft, drawableRight, drawableTop, drawableBottom. They can be used for settings, search, delete item etc. 1 or higher devices. gistfile1. Forms app? android - How to use CheckBox in Options Menu How to set selected item of Spinner programmatically in Android. We are going to learn the different options available to you. Increase decrease spinner inside text items font size look bigger or smaller in android app. xml looks like this text color of I couldn’t get an Android ActionBar menu item icon to appear in the action bar until I followed the XML namespace example shown in the image (which comes from this url). Something like this. Creating an Overflow Menu. Holo. R. Creating Android button with image and text using relative layout by Goran Siric on Monday, October 3, 2011 7:06 AM If you just want to create basic button with image and text on it, you can use standard android button control and one of the following properties: drawableLeft, drawableRight, drawableTop, drawableBottom. In our selector we are providing a default color and for state focused, there will be different color and for state pressed, the text will show different color. The source code shows all the steps needed to create a menu item and respond to a user tapping/clicking the button. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have android - Add, update and remove Menu item programmatically activity_main. Its currently showing up as a white checkbox on a white background, it needs to be a red checkbox on a white background. featuring larger menus and the teal color scheme for text and How to change a Spinner text size, color or overall style Changing the text size or color of a Spinner is not as simple as just using the android:textSize attribute on the Spinner element. widget declare the menu item of the How to style AlertDialogs like a pro. To add actions to the action bar, create a new XML file in your project's res/menu/ directory. How to add border on Android TextView. Black. How to change Menu Item text Color of holo theme in Android? Android: I am using Theme. - Yalantis/Context-Menu. 6 Responses to Changing background color and border color of an EditText widget using State List in Android Ryan on September 3, 2012 at 7:02 pm Thanks for your article This tutorial describes the principles to style Android applications. add (CharSequence title) – adds a new menu item with a text given by the title argument We will see an Exaple that will Display SubMenu for Background & TextColor of the Text View Whatever color you will select that will be set as Backfround and Text color respectively We will create menu "Text Color" and "Text Color" and add the Sub Menu to these menus. Styles are hard to get right on Android. id. Setting Text Color On Button Inside Java class: Below is the example code in which we set the text color of a Button programmatically means in java class. Set Button width and height : Button « UI « Android layout_height="wrap_content" android:text="Change Text Color Add key listener to add the new todo item This post explains how to change the color of the standard Android button. This is a follow up to the Options Menu Tutorial shared earlier. xml file. Change/Set listview background color in android programmatically. Creating android menu with menu items. Hi, All! I want to change the look of my Android app's preference screen to white background and dark text color I try: Variant 1: In my How do i set the background color of a view programmatically. menu. AppCompat. widget. ShaderFactory { public Find out how to build a customizable Android app, where the user can change the app's theme dynamically at runtime. IconMenuItem”View for the menu layout. Toolbar/Actionbar Menu Items; Android Change Tab Icon/Text/Background Color/Text This short tutorial shows how to get Android menu item icons to show menu item icons to show (without compatibility libraries) only as text in the overflow Apps Set TextView Width To WRAP_CONTENT //text. xml This is a follow up to the Options Menu Tutorial shared earlier. android:onClick Also include the title text (defined by android: method to set the attribute values programmatically. A contextual menu offers actions that affect a specific item or context frame in the UI. Change menu item background color and text color: Android Remove app from recent apps programmatically: Android; Use of custom analog clock class:- ActionBar Option Menu item ignores setVisibility(View. how? View 2 Replies View Related Android :: How To Change Text Color Of Menu Item In Phone? Android Spinner Programmatically add/remove Items Spinners are android version of dropdown options much like a HTML <SELECT>. Set Styles programmatically in Android April 29, 2013 Styles in Android are a very useful kind of resources which allow us to easily configure a set of components. For doing this we need two methods: Set text color for menu item: Reset all menu items text color: We are… May 27, 2010. that you always define android:title for each menu item, even if You can identify the menu item by calling getItemId(), which returns the unique ID for the menu item (defined by the android:id attribute in the menu resource or with an integer given to the add() method). Menu selected item color. This android tip is about learning how to strike through or cross out in text in android. This attribute is used to set the text color of a CheckedTextView. This program has been started to help beginners, i tried to explain things in simple way for Urdu and English speakers, Main purpose of this program is to teach java and android programming and How to programmatically click / select / tap a listview item. xml)uses a custom item of class “com. ExpandableListView is a type of view very much similar to a ListView but allows two levels. Change the tooltip text associated with this menu item. How to set color filter to drawable programmatically in android Example; Blur Effect to Image View in Android using RenderScript – {Working Example} Creating text selector for TextView to change text color when users presse or click on TextView. The callback allows you to update your menu items Android TextView span full width programmatically. Products. However, whenever you want to change the menu, you should call invalidateOptionsMenu(). background color. This involves the use of the <menu> element, containing an <item> sub-element for each menu item. Change listview Item text color android programmatically. Build Menus in Android with Java and XML: Introduction. It also shows how to change the color of the text inside those buttons. How do i change the color of the checkbox menu item. In this Android tip, I am going to show you how to add a border to the TextView in layout xml file and in code. Menu options are managed by android. This workaround might save you hours of The Spinner class has no methods for setting text color, so how do you set the text color of a closed spinner? All items in a Spinner are TextViews. public static void hideAppIcon(Context context) Android set padding programmatically in dp(dip) Android EditText text change listener example Android Spinner set Selected Item by Value Style Android's overflow menu using this sanity saving workaround Styling the overflow menu on Android is poorly documented and hacky and can drive you mad. Adding headers to TListView programmatically Posted by Sarina D on Wednesday, 2 September 2015 in UI During today's Delphi, C++Builder and RAD Studio 10 Seattle launch webinar, I got a question on how to add headers to TListView programmatically instead of using LiveBindings with a data source. This example show how to enable/disable menu item dynamically using Java code, set with ToggleButton. MenuItem objects which are created using the add() method of the Menu reference:. How To Change Color Of Spinner Selected Item In Android December 5, 2015 by blogmeister · 0 Comments Share the post "How To Change Color Of Spinner Selected Item In Android" 12 Responses to Adding Action items and Overflow menu items to i-show-overflow-menu-items-to-action-bar-in-android. xml looks like this text color of Set Styles programmatically in Android April 29, 2013 Styles in Android are a very useful kind of resources which allow us to easily configure a set of components. Changing text color of a MenuItem programmatically (Android) Raw. setOnItemSelectedListener(new OnItemSelectedListener()). For more clarity you can download the example for “Android Messaging Example for Sending SMS Programmatically” from buttom of this post. In this tutorial, we are going to learn how to highlight or set RecycleView item row background color in android when clicked. ActionBar with Menus in Android Xamarin This code sample demonstrates the different types of menus available in Android and its ActionBar. Android ActionBar Example Tutorial. BackgroundColor = Color. xml. Can't understand why it doesn't seem straight forward to change an apps Title background color and also Text color?? Android: Change colour of drawable asset programmatically with animation. The light theme expects your App Bar 1 (Toolbar or ActionBar) to have a light background color, so it gives you a May 27, 2010. How can I set the text color of the overflow menu item to a Android EditText focus border color. view. In this example we display a basic ListView from SQLite database using the SimpleCursorAdapter which by default doesn't have the zebra stripes on the rows. Aug 19, 2010. FromHex("#00162E"); This easy hack allows you to customize the text color and background of Android's search view widget. featuring larger menus and the teal color scheme for text and Android Spinner customized to show image and text , programming tip with clear explanation and example code. setBackgroundResource(R. setTitle(HOME_MENU_ITEM_SET_HOME_PAGE); So, in summary, if you needed to see how to access an Android MenuItem from your Java Activity or Fragment code, I hope this is helpful. the last one the title text you want so this may not be a bug there's just no exposed way in code to change the selected item background color. layout. In Android, colors can be defined directly, such as "#ff0000" for red. On click of Long-Press Menu Text Color (not the Menu Button "bottom popup menu") i'm having a hell of a time finding the necessary XML edits to change the text A deeper look at the new quick settings menu in Android Lollipop putting what Google thinks are most important items up front. How to change the Text color of Menu item in Android? 3. Android Bottom Navigation View Tutorial With Example itemTextColor — Use this attribute to set the text color of the item in import android. text color in Change spinner items background color in android programmatically. . To show image by XML, we need to add ImageView tag in our layout in XML. You can identify the menu item by calling getItemId(), which returns the unique ID for the menu item (defined by the android:id attribute in the menu resource or with an integer given to the add() method). In this post I will show you how we can change MenuItems text color programmatically. xml GitHub is where people build software. Text = "File Menu" The Image property is used to set an image as part of a menu item with the On this page we will provide Android ImageView example by XML and programmatically. xda-developers Android Development and Hacking Android Q&A, Help & Troubleshooting Button text color by badboy_6120. How to change individual action item text color in ActionBar PROGRAMMATICALLY? Ask Question. So the end for get contact list in android studio programmatically tutorial. The android:actionViewClass="android. This attribute lets you specify a resource from which the current style will inherit values. How do we change the background color of Android options menu? color based on the state of the menu item. snackbar_text. How to change the color of the text indicator of tab? i can change the icon using selector tag refereed the example. With help of Design Library we can provide same animation effect from Android 2. It also explains how to create and use styles and themes in Android applications Creating text selector for TextView to change text color when users presse or click on TextView. color. Value of this attribute must be a resource, for example - @android:color/white , not a color value as #ffffff Hey together, has anyone already changed the Background Color of the Android PopupMenu in a Xamarin. 2. 1 onward devices. By Zed Jensen May 9, 2013 I’ve been writing a timesheet tracking app for End Point. In Android TextView is a widget that allows you to display text. xml, can I change the menu buttons' standard text size, color etc using xml? Change listview Item text color android programmatically. Android Spinner customized to show image and text; Android Spinner and its item selection; Android custom menu; Home » Snippets » Android – Button with text color changed on click Android – Button with text color changed on click Posted by cristi on Jul 17, 2014 in Snippets | 0 comments Android ActionBar Example Tutorial. Set spinner style, text color with spinner adapter. How to change a Spinner text size, color or overall style Changing the text size or color of a Spinner is not as simple as just using the android:textSize attribute on the Spinner element. If AppTheme is android:Theme. That dark grey . " How to add items to Android set padding programmatically in dp(dip) Android EditText text change listener example Android Spinner set Selected Item by Value Android Snackbar – Change Text Color, Background Color, Action Button Color Snackbar’s Text Color, Background Color, Action Button Color could be changed using view. Im using android studio and my theme is a child of Theme. Menu Android switch button example A switch is type of button that can only have two states ON and OFF. setTextColor(Color. Identify the group item and add “app:actionViewClass=android. To recap, the Context Menu is a floating list of menu items that appears when a user Context Menu Android Tutorial - DZone Android Option Menu Example. This page will provide Android button Selector color example. Setting icon and title for each menu item. Color value is in the Creating Android Sliding Sidebar (Hamburger) Menu with Navigation Drawer Icon By now most of us are familiar with Navigation Drawers as they’ve been in use by Facebook, Gmail, Google Play Music, Google Play Music and tons of others apps. You can also create a resource file under /res/values folder (with any file name), with your own color id defined inside. Android Design Support Library brings a number of material design components that are compatiable with all Android 2. When you apply the textSize to a Spinner, like so: I want to change ListView items text color, But android:textColor="#FF0000" in xml layout file not work. g. To achieve the goal, first you need a custom menu file (to be saved in the res/menu folder) that has a Spinner. The application described here is Dynamically adding items to Spinner Widget in Android | Knowledge by Experience Menu. android menu item text color programmatically