How can I use onItemSelected in Android?

后端 未结 7 2089
忘掉有多难
忘掉有多难 2020-12-03 00:43
package org.example.mbtiapplication;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widge         


        
相关标签:
7条回答
  • 2020-12-03 01:32

    For Kotlin and bindings the code is:

    binding.spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener{
                override fun onNothingSelected(parent: AdapterView<*>?) {
                }
    
                override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
                }
            }
    
    0 讨论(0)
提交回复
热议问题