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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:59:15+00:00 2026-06-01T00:59:15+00:00

I have a problem like I had a Spinner containing the Names of all

  • 0

I have a problem like I had a Spinner containing the Names of all developers working in the Company.
I have used the ArrayAdapter with a Array having the names of all the developers which is fetched from the database.

The problem is that when I update the Name Of Developer field, I get Only the Name of the Developer which is not enough to update the data as their can be multiple developers with the same name in the Company.
So now I require the id of the developers to update it..
How to store that id of the developers with the Spinner so that I can achieve this.

For example, I want to do like is as that we do in HTML::

<select>
<option id="1">Developer1</option>
<option id="2">Developer2</option>
<option id="3">Developer2</option>
<option id="4">Developer2</option>
</select>

where the id attached would be the database id.
I want to imitate this in android.

This the code that I have used to store the names in the array::

String alldevelopers = null;
try 
{
  ArrayList<NameValuePair> postP = new ArrayList<NameValuePair>();
  alldevelopers = CustomHttpClient.executeHttpPost("/fetchdevelopers.php", postP);
  String respcl = alldevelopers.toString();
  alldevelopersParser dev = new alldevelopersParser();
  ow = dev.parseByDOM(respcl);
} 
catch (Exception e) {
   e.printStackTrace();
}  

String developers[] = new String[ow.length];    //dev is a class object  
for (int n = 0; n < ow.length; n++)   
{  
  developers[n] = ow.developer[n][2];
}  

This is the Spinner that would spin the array..

final Spinner devl = (Spinner) findViewById(R.id.towner);  
devl.setOnItemSelectedListener(managetasks.this);
ArrayAdapter<String> b =   
new ArrayAdapter<String>getApplicationContext(),  
android.R.layout.simple_spinner_item,developers);  
b.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);  
devl.setAdapter(b);
  • 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-06-01T00:59:17+00:00Added an answer on June 1, 2026 at 12:59 am

    When you perform setOnItemSelectedListener on the spinner then you have method such as

    public void onItemSelected(AdapterView<?> adapterView, View view,
                        int position, long id) {}
    

    here you can findout the position of selected developer name of spinner and use this position to fetch data from array.

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

Sidebar

Related Questions

I have a problem like,array with 0 10 indexes and i removed 0th index
I have a problem: suddenly (exactly like that) my Eclipse IDE had lost the
I have this problem where all URLs like context/path/file/anything/that/follows becomes context/path/file.php/anything/that/follows or context/path/file.xml/anything/that/follows .
Looks like others have had this problem but I can't seem to find a
i have problem using LIKE structure in DB2 : for example: select * from
I have a problem i would like parallelize two for loops with openmp. how
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']
i have the following problem: i would like to create a footer. that footer
I have a problem where I have some html like this <p>There is the
I have a problem where I have code like <table id=table> <tr> <td>...</td> <tr>

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.