android - ArrayAdapter.createFromResource issue -
i trying make "select one" on spinner. saw answer regarding subject still having issues. usual way of making custom spinner is:
arrayadapter<charsequence> dataadapter1 = arrayadapter.createfromresource(this, r.array.entries, android.r.layout.simple_spinner_item); dataadapter1.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spinner1.setadapter(dataadapter1); spinner1.setadapter( new nothingselectedspinneradapter( dataadapter1, r.layout.contact_spinner_row_nothing_selected, this));
in code have define r.array.entries in strings.xml, app populating spinner mysql , having list grad[i]=json.getstring("grad");
. how can create arrayadapter.createfromresource list instead of entries defined in strings.xml? tnx
query data, put in list
or array , use constructor of array adapter
arrayadapter<charsequence> dataadapter1 = new arrayadapter(this, android.r.layout.simple_spinner_item, yourarrayorlist);
Comments
Post a Comment