Ok this has worked for me:

                   Spinner s2 = (Spinner) findViewById(R.id.spinner2);
                   db.open();
                   Cursor cur = db.getAllTitles();
                   SimpleCursorAdapter cadapter = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, cur,
                       new String[] {KEY_TITLE},
                       new int[] {android.R.id.text1});

                   cadapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
                   s2.setAdapter(cadapter);



on another matter, I want to see my database, I rezlied that I do not
have the persmission to see it from the device, how can I see it from
the emulator on Eclipse? I read the documentation and on the MS DOS
prompt after writing adb -s emulator5554 shell and trying to connect
to the database it can't find it and I can't see it  on the project
explorer in Eclipse?

any ideas?

10x




On Jun 19, 11:40 am, Georgy <[email protected]> wrote:
> Mark thanks for the helpful link,
>
> I still can't tell how to use manageQuery with my table (and not a
> built in table such as CONTACTS).
>
> My database is: locode
> My Table is: chart
>
> and I have several columns and rows in it. My column that I want to
> show is called KEY_TITLE
>
> So in this line I don't know what to replace:
>
> Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null);
> SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
>     android.R.layout.simple_spinner_item,  cur, new String[]
> {People.NAME}, new int[] {android.R.id.text1});
>
> I really appreciate your help
>
> On Jun 18, 4:19 pm, "Mark Murphy" <[email protected]> wrote:
>
> > > Mark thanks for the reply,
>
> > > To be more specific, here is a snippet from my spinner code:
>
> > >    String[] array = {"Select", "Building", "Here"};
> > >               Spinner s2 = (Spinner) findViewById(R.id.spinner2);
> > >               ArrayAdapter<String> cadapter = new ArrayAdapter(this,
> > > android.R.layout.simple_spinner_item, array);
> > >               cadapter.setDropDownViewResource
> > > (android.R.layout.simple_spinner_dropdown_item);
> > >               s2.setAdapter(cadapter);
>
> > > my problem is replace array (to make it dynamic) with my 'title'
> > > column from my 'chart' table in my 'dbm' database.  I know it's a
> > > simple line, but I can't seem to get  it.
>
> >http://developer.android.com/guide/topics/ui/binding.html
>
> > The first code listing shows two spinners, one using an ArrayAdapter, one
> > using a SimpleCursorAdapter wrapping the result of 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