I am developing an android application in which I am populating a spinner from database using simpleAdaptor.
SimpleCursorAdapter deptype =new SimpleCursorAdapter(this,R.layout.dbspinner, depcur, from, to); dep.setAdapter(deptype);
Data is loading fine but I don’t like the “Look” of the Spinner.
The spinner I got with
ArrayAdapter<CharSequence> practype = ArrayAdapter.createFromResource(this,R.array.practice, android.R.layout.simple_spinner_item);
is more beautiful with a radio button on the side,while the one I got is just showing contents separated by lines which is not at all beautiful.
I tried various changes in my layout of dbspinner but nothing is equal to the default stock spinner in android. I also tried to replace dbspinner with android.R.layout.simple_spinner_item but I got blank boxes with radio buttons but no text.
How can I get the stock default spinner?
Should i load the contents of database into a string and give to array adapter? If so how to it?
The simple_spinner_item is defined as:
So to use it as your item’s view, use “text1” as your id in the resource integer array.
Ie: