java - android spinner not getting value -


i've been trying figure out, each example find online totally misguiding me (could because new android). want value of selected item spinner. did following:

public class adddiscountactivity extends activity implements onitemselectedlistener{ 

then inside main class defined string shopcategory. implemented method inside class:

@override     public void onitemselected(adapterview<?> parent, view view, int pos, long id)      {         // todo auto-generated method stub         shopcategory = parent.getitematposition(pos).tostring();     } 

nevertheless, still value empty because in database, fields showing except category. ay recommendations?

i wrote spinner tutorial on blog while back. helps little bit

http://www.emmbimobile.com/blog/2013/03/25/spinner-dropdown-list-tutorial/


Comments