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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:10:42+00:00 2026-05-18T22:10:42+00:00

my coding is working well .But I want to store the edited spinner value

  • 0

my coding is working well .But I want to store the edited spinner value in the database how it be done.here is my code

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class tooo extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Spinner localSpinner = (Spinner)findViewById(R.id.color_spinner);

        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.color_array, R.layout.my_normal_spinner_item_style);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        localSpinner.setAdapter(adapter);    
    }
}

my simple_spinner_dropdown_item.xml

  • 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-18T22:10:43+00:00Added an answer on May 18, 2026 at 10:10 pm

    Add follwoing after setting the adapter in your code

    localSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() 
        {
            public void onItemSelected(AdapterView parentView, View childView, int position, long id) 
            {
                String text = localSpinner.getSelectedItem().toString();
                //The above text variable has the selected value of spinner
            }
            public void onNothingSelected(AdapterView parentView) 
            {
            }
        });
    

    Why didnt you edited question in your last post rather than creating a new post

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

Sidebar

Related Questions

I'm working for a company that has strict coding style guidelines but no automatic
I'm working on a project where I'm coding in C in a UNIX environment.
I've been working through the Stanford iPhone Coding course and currently hooking into the
I've been working with a small group of people on a coding project for
I'm used to doing all my coding in one C file. However, I'm working
I'm coming from Eclipse, working in Visual Studio 2008 Express and just want to
I am coming from Java and am currently working on a C# project. What
I'm working on a social networking system that will have comments coming from several
When coding web services, how do you structure your return values? How do you
In coding a traditional MVC application, what is the best practice for coding server-side

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.