android - Change EditText to Spinner with hardcoded data -


in following code, users can type category desired , save parse table. want avoid user input typos , use spinner hardcoded categories user can select dropdown menu. unable create spinner have no previous experience spinner widgets. can provide sample of how accomplish this? current code.

event.put("category", meditcategory.getedittext().gettext().tostring()); // meditcategory.getspinner?????             string strcat = meditcategory.getedittext().gettext().tostring();             if (textutils.isempty(strcat))             {                 meditcategory.seterror("especifique una categoria: trafico/chismes");                 return;             } 

thank valuable time.

i'd recommend taking @ this example , explanation mkyong. thorough , should able follow along easily. answer primary question hardcoding options: you'll see in example, you'll use list specified in strings.xml file code load up.


Comments