Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda