> I created a database with records in it and everything. I am trying to
> use its fields and put it in a spinner.  The database contains
> university names.  I created a spinner with:
>
>    final Spinner s = (Spinner) findViewById(R.id.spinner);
>           ArrayAdapter adapter = ArrayAdapter.createFromResource(
>                   this, R.array.universities,
> android.R.layout.simple_spinner_item);
>           adapter.setDropDownViewResource
> (android.R.layout.simple_spinner_dropdown_item);
>           s.setAdapter(adapter);
>
> where I am feeding the spinner the records from an array. I want to do
> it from the database that I created. I read thru the classes and there
> are 2 ways but I can't find a proper code to use any of them.  I just
> want to insert the code to get records from the database. It shouldn't
> be complicated is it?

Use a CursorAdapter (or SimpleCursorAdapter) to wrap the Cursor you get
back from a database query().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to