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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:59:09+00:00 2026-05-29T08:59:09+00:00

I am trying this code findUsStateOrMileSpinnerState.setOnItemSelectedListener( new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView<?> adapterView, View

  • 0

I am trying this code

findUsStateOrMileSpinnerState.setOnItemSelectedListener(
  new AdapterView.OnItemSelectedListener() {
    public void onItemSelected(AdapterView<?> adapterView, View view, 
         int i, long l) 
    { 
       spinnerState = findUsStateOrMileSpinnerState.getSelectedItem().toString(); 
       if(spinnerState.equalsIgnoreCase("State")){
           getDetailsState();
       }
       if(spinnerState == "Miles"){
            getDetailsMiles();              
       }    
    } 

    public void onNothingSelected(AdapterView<?> adapterView) {
       return;
    } 
  }
); 

On some selected item it should call another listener.
Spinner is having Miles and State.
But it is not going through the if statement, am I doing something wrong.
Looking forward to your reply.
thanks.

  • 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-29T08:59:10+00:00Added an answer on May 29, 2026 at 8:59 am

    Did you try using the eqauls() method for comparing two strings in your code instead of == operator ?

    if (spinnerState.equals("Miles") {
        getDetailsMiles();
        ...
    }
    

    Check this out plz : http://www.java-samples.com/showtutorial.php?tutorialid=221

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

Sidebar

Related Questions

I'm trying this code: arrList = new List<CheckBox>(); for (int j = 0; j
I am new to Django and was trying this code in a tutorial. But
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
i m new to iphone ... trying this code but getting some error help
To be specific, I was trying this code: package hello; public class Hello {
I am trying this code: entLoop:for(var i:*in entities) { for(var i2:*in ignoreEntities) { if(entities[i].type==ignoreEntities[i2])
I'm trying this code to access a property but it gives me an error:
Boost Network I am trying out this code in a small console app on
I trying to compile this code: Int64 itag = BitConverter.ToInt64(temp, 0); itag &= 0xFFFFFFFFFFFFFC00;
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now

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.