Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:53:50+00:00 2026-05-30T13:53:50+00:00

In my Android application, I am using spinner, and I have loaded data from

  • 0

In my Android application, I am using spinner, and I have loaded data from the SQLite database into the spinner, and it’s working properly. Here is the code for that.

Spinner spinner = (Spinner) this.findViewById(R.id.spinner1);
List<String> list = new ArrayList<String>();
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>  (this,android.R.layout.simple_spinner_item, list);
cursor.moveToFirst();

list.add("All Lists");

if (cursor.getCount() > 0) {
    for (int i = 0; i < cursor.getCount(); i++) {
        keyList[i] = cursor.getString(cursor.getColumnIndex(AndroidOpenDbHelper.KEYWORD));
        list.add(keyList[i]);
        cursor.moveToNext();
    }
}
Database.close();
cursor.close();
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(dataAdapter);

Now I want to change the text color and text size of spinner data. I have used following XML lines to my spinner tag on my XML file, but it is not working.

android:textColor="@android:color/white"
android:textSize="11dp"

How can I change the text color and text size of my spinner?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:53:52+00:00Added an answer on May 30, 2026 at 1:53 pm

    Make a custom XML file for your spinner item.

    spinner_item.xml:

    Give your customized color and size to text in this file.

    <?xml version="1.0" encoding="utf-8"?>
    
    <TextView  
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:gravity="left"  
        android:textColor="#FF0000"         
        android:padding="5dip"
        />
    

    Now use this file to show your spinner items like:

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.spinner_item,list);
    

    You don’t need to set the drop down resource. It will take spinner_item.xml only to show your items in spinner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application using an SQLite database. I open the database when
I have an Android application that I've been working on, and it's implemented using
i am developing an android application using google maps data.I can access google maps
My Android application is expecting and array of usernames from my WCF Service using
I'm trying to use custom notifications in my Android application using Google's sample from
I am using Spinner control in my application and my Code is Spinner s1=new
I am developing an android application using google maps. I have to display some
I have created a Android application using Google Maps. Now I want to check
I'm trying to call a RESTful web service from an Android application using the
I am trying to port some c++ code to my android application using NDK.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.