Category : android-spinner

i am trying to populate a sppiner from a mysql, i recive the data from SQL, but the sppiner keeps blank if i click on it show all data, but it’s impossible to select one: XML: <Spinner android:id="@+id/spinnerProducts" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent"/> method that get data from data base public class ProductsDao { public static List<String> ..

Read more

Im trying to implement editting cart in my project..for that i have used spinner Adapter::——– var country = arrayOf(1, 2, 3, 4, 5, 6, 7, 8) . . . val aa: ArrayAdapter<*> = ArrayAdapter<Any?>(context, android.R.layout.simple_spinner_item, country) aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) holder.spin.setAdapter(aa) holder.spin.setSelection(dataList?.get(position)?.quantity!! – 1, false) holder.spin.setOnItemSelectedListener(object : OnItemSelectedListener { override fun onItemSelected( parent: AdapterView<*>, view: View, position1: Int, ..

Read more