Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Android Spinner jumps to previous selected positions

I am using AppCompatSpinner to show the list of states. Initially, I saved the first position item. Then After if I click the spinner and try to scroll slowly that time it goes to the previous position. if I scroll little fast it's working. During slow scroll and long press on the spinner, list item creates a problem.Can anybody know how to resolve this issue? here is my spinner.

   <androidx.appcompat.widget.AppCompatSpinner
                    android:id="@+id/stateSpinner"
                    style="@style/Widget.AppCompat.Spinner.Underlined"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:theme="@style/SpinnerStyle"/>


       val adapter = ArrayAdapter(
        context,
        R.layout.spinner_item, stateList
    )

    adapter.setDropDownViewResource(R.layout.spinner_dropdown_item)
    stateSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
        override fun onItemSelected(adapterView: AdapterView<*>, view: View, i: Int, l: Long) {
            viewModelOffice.officeSelectedState.set(stateList.get(i))

        }

        override fun onNothingSelected(adapterView: AdapterView<*>) {
        }
    }
    stateSpinner.adapter = adapter
    stateSpinner.setSelection(selectedPosition)
}

In theme, I am just setting the colors.minimum version of the app is 21. Any Help will be Appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Finally it is worked for me

Problem is anroidx update libs

Resolve by revert version appcompat from "alpha02/alpha03" back to "alpha01"

implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'

or better

implementation 'androidx.appcompat:appcompat:1.0.2' -> for more stable

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!