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 6560673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:26+00:00 2026-05-25T13:29:26+00:00

My question is: I am using spinner on my android app. However, I can’t

  • 0

My question is: I am using spinner on my android app. However, I can’t see the default value shown on the spinner, at all. I can select elements but I can’t see any text on the spinner. It seems like the value is hidden and doesn’t show anything, just the spinner itself and drop down arrow.

mDbHelper = new DbAdapter(this);
    mDbHelper.open();
    cursor = mDbHelper.fetchAllBusinessCards();
    startManagingCursor(cursor);
    contactSpinner = (Spinner) findViewById(R.id.contactSpinner);

    contactSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
    fillData();


}
public class MyOnItemSelectedListener implements OnItemSelectedListener {

    public void onItemSelected(AdapterView<?> parent,
        View view, int pos, long id) {
      Toast.makeText(parent.getContext(), "The planet is " +
          parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();
    }

    public void onNothingSelected(AdapterView parent) {
      // Do nothing.
    }
}

private void fillData() {



/*Create an array to specify the fields we want to display in the list (only the 'colourName' column in this case) */

String[] from = new String[]{DbAdapter.getKeyTitle() }; 
/* and an array of the fields we want to bind those fields to (in this case just the textView 'tvDBViewRow' from our new db_view_row.xml layout above) */
int[] to = new int[]{R.id.tvDBViewRow};

/* Now create a simple cursor adapter.. */ 
SimpleCursorAdapter colourAdapter =
new SimpleCursorAdapter(this,R.layout.db_view_row, cursor, from, to);

/* and assign it to our Spinner widget */ 
contactSpinner.setAdapter(colourAdapter);
//contactSpinner.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
contactSpinner.setSelection(0);

}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mDbHelper != null) {
        mDbHelper.close();
    }
}

}
  • 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-25T13:29:27+00:00Added an answer on May 25, 2026 at 1:29 pm

    You can call spinner.setSelection to set the current state of the
    spinner to whatever you want. And that definitely works

    spinner.setSelection(0);
    

    but you must also call
    setDropDownViewResource()

    let say

    adapter.setDropDownViewResource(
    android.R.layout.simple_spinner_dropdown_item);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question Using XSLT 1.0, given a string with arbitrary characters how can I get
i have a question about using GalleryView. At first, i set five default images
Just a quick question about using select() . I'm using select() to read from
I had a question using Perl's readdir(). I want to gather all the files
Question Using iTextSharp, can I skip over the first page of the document, and
Can someone please help me with that problem. The question: Using the API, How
I am using .Net and Monodroid to develop Android applications, however I seem to
Question: Using Ruby it is simple to add custom methods to existing classes, but
I recently posted a question using a lambda function and in a reply someone
I have a question about using streams in .NET to load files from disk.

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.