In my layout xml I have a spinner and in my java I have a database with contacts and some values on it so I want to know how I send or put these values from the database in the spinner so when I click it, it selects the contact, any example of code?
Share
Get the contacts details from the database first.
You can find a sample code for database concept at http://codinglookseasy.blogspot.in/2012/08/sqlite-database.html .
Next from the above sample you may have got ArrayList of objects and set the contact names in the spinner using a
Where list here may be the data from your ArrayList from the database. (store a specific field that you want to display from the database into this list).
Get the item selected using
which gives the item selected and get the data using from the ArrayList that you got from the database