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

  • Home
  • SEARCH
  • 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 6588023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:59:38+00:00 2026-05-25T16:59:38+00:00

I have created a spinner and the items of spinner comes from database. However,

  • 0

I have created a spinner and the items of spinner comes from database. However, When I use

public class MyOnItemSelectedListener implements OnItemSelectedListener {

    public void onItemSelected(AdapterView<?> parent,
        View view, int pos, long id) {
        typeOFBCard = contactSpinner.getSelectedItem().toString();
    }

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

When I call this listener and try to pick the chosen string of the spinner i get a reference of the sglite something like:

android.database.sqlite.SQLiteCursor@40535568

This is the return value of typeOfBCard.

However, on the spinner I can see normal string like “Work”.

Here is how I initialized the spinner :

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

    contactSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
  • 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-25T16:59:39+00:00Added an answer on May 25, 2026 at 4:59 pm

    How ever on the spinner I can see normal string like “Work”

    That is because you configured an Adapter on the Spinner, and the Adapter is pulling data out of the Cursor to display.

    How to get spinner string value on android?

    There is no “spinner string value”. Spinners don’t have strings. They have views. Those views might be instances of TextView, or they might be instances of ImageView, or they might be instances of a LinearLayout holding onto a TextView and an ImageView, or…

    If you want to get data out of the Cursor, call getString() on the Cursor.

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

Sidebar

Related Questions

i have public class ExperimentAllInOneActivity extends Activity implements OnClickListener on each button click listener
I have created a drop down in my android application using a spinner. However
i have created a spinner.could i place my spinner items in a table into
I have a spinner that show my data list from a database SQLite.. I
I have created an application for ContactsContract... I have created a spinner which brings
I have created a currency fomatter class. I want this to be a util
I have created a spinner with 3 options: Beginner, Advanced and Pro. When one
I am wanting to create a Spinner from an ArrayList of Objects I have
I have a created a custom ArrayAdapter to hold a tuple. I use one
I have created a spinner which is automatically updated with appliance names when a

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.