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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:11:38+00:00 2026-06-15T13:11:38+00:00

the first spinner is ok, the second spinner is ArrayList, ArrayAdapter<> and it loads

  • 0

the first spinner is ok, the second spinner is ArrayList, ArrayAdapter<> and it loads a folder of file names, so, im wondering how to use the if() like file name contains,or list item contains, because each of the files either starts with a 62 or a 31.

     public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
        long arg3)
{
    switch(arg0.getId())
    {
    case R.id.spinner:
    {
    if(arg2 == 0)
    {
        break;
    }
    if(arg2 == 1)
    {
        Intent myIntent = new Intent(Inspector.this, hord.class);
        Inspector.this.startActivity(myIntent);
        break;
    }
    if(arg2 == 2)
    {
        Intent myIntent = new Intent(Inspector.this, hord.class);
        Inspector.this.startActivity(myIntent);
        break;
    }
    }
    case R.id.recent:
    {
        if(arg1.getContentDescription().toString().contains("62"))//what im trying to do
        {
            deviation.setText("jobwelldone");
        }

    }
    }

    // TODO Auto-generated method stub

}
  • 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-15T13:11:39+00:00Added an answer on June 15, 2026 at 1:11 pm

    Once you have saved your filenames in a String array then you can iterate through the array using the for loop for example and use the

    indexOf() 
    

    method that searches the calling String object for the String passed to it. For example:

    ( if filename.indexOf(String.valueOf(62)) == -1 ) 
    

    // means that filename String doesn’t contains ’62’ substrng because the indefOf() method returned -1. Otherwise filename String contains ’62’ substring.

    To get an item from a spinner:

    spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            Object item = parent.getItemAtPosition(position);
        }
        public void onNothingSelected(AdapterView<?> parent) {
        }
    });
    

    or use:

    String spinnerValue = mySpinner.getSelectedItem().toString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a array list for using it in spinner ,i have first value
When I click on the first item in the spinner, or the default one,
For an Android application, I'm trying to use a Spinner which, when an option
i have 2 arrays first for Hours and second for minutes, this is my
How can I build a view like this? Maybe first row image and then
I am trying to use the jQuery UI 1.9 spinner for the quantity field
I have One Spinner in AlertDialog. On First look their will be only on
So, I have two spinners, let's call the first spinner Parent (account_type_spinner) and the
I have an Android Spinner widget in which I'd like to display a slightly
I want to set the hint in spinner. Like in edit text, I am

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.