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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:10:18+00:00 2026-06-13T19:10:18+00:00

i Have a Spinner on my activity that contains a list of String, it

  • 0

i Have a Spinner on my activity that contains a list of String, it is declared like this:

String[] notificationStatus = new String[statuses.size()];
        for (int i =0; i<statuses.size();i++){
            notificationStatus[i]=statuses.get(i);
        }
        ArrayAdapter<String> aa = new ArrayAdapter<String> (
                this, android.R.layout.simple_spinner_item, notificationStatus );

        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(aa);
        spinner.setPrompt(getString(R.string.chooseType));
        spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
            public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
                posType=position;
            }

            public void onNothingSelected(AdapterView<?> parentView) {
                // your code here
            }

            });

Now when i start this activity i got first item of notificationStatus Array on the button (possition 0 at spinner), is there a way to start a activity and put for example 3rd item of the array at the possition of 2?

  • 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-13T19:10:20+00:00Added an answer on June 13, 2026 at 7:10 pm

    Actually i have found out how to do this.
    First i create a list from the array:

    List<String> statusCheck = new ArrayList<String>();
            statusCheck = Arrays.asList(notificationStatus);
    

    Next i check where on the list is String i am looking for and put set selection on it:

    spinner2.setSelection(statusCheck.indexOf(status));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one spinner, and I am populating that. I have list of values
my 1st page have a spinner, that will parse value to the 2nd activity..
In my main activity I have a spinner which contains three categories(All,Horizontal and Vertical),
I have a activity that extends listactivity, extended in this class i have a
I have a spinner in my activity with a list of options, When the
I have a spinner in my Child activity . That means my activity is
I have a spinner that populates list of options properly at first. Then when
I have an activity with a spinner which loads a simpleCursorAdaptor. I call another
I have a Spinner and a SimpleCursorAdapter . For odd/even rows on this spinner
Hi I have a spinner for which I would like to change its entry.

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.