The parent class of the inbuilt android spinner is the AbsSpinner, a an abstract adapterview.However, sometimes we are not so much attracted to the inbuilt or default spinner, due to functionality limitations or we just want something nicer. Thus allowing ussers to select only one item at a time. Use getDropDownView() for opened Spinner. A spinner is an android widget that basically displays items in dropdown. I have done this as following.I have use getDropDownView() and getView() methods. View view = super.getDropDownView(position, convertView, parent) ĪtDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) Spinner spinner = (Spinner) this.findViewById(R.id.spinner1) ĪrrayAdapter dataAdapter = new ArrayAdapter (this,android.R.layout.simple_spinner_item, list) įor (int i = 0 i < cursor.getCount() i++) ->in this line very important so add View getDropDownView(int position, View convertView,In my Android application, I am using spinner, and I have loaded data from the SQLite database into the spinner, and it's working properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |