0

The spinner comes up with but with nothing in it

what am I doning wrong?


cbookmarks = Browser.getAllBookmarks(getContentResolver());
SimpleCursorAdapter ABM = new SimpleCursorAdapter(this,android.R.layout.simple_spinner_item, cbookmarks,new String[] {android.provider.Browser.BookmarkColumns.URL},new int[]{R.id.Spinner});
ABM.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
SpinnerBM.setAdapter(ABM);

Thanks.

Hell.Bent
  • 1,667
  • 9
  • 38
  • 73

1 Answers1

1

Is R.id.Spinner a TextView? Perhaps you can post the XML you have defined for the layout of the entries?

UPDATE
According to the documentation the array of id's that you pass into the SimpleCursorAdapter constructor need to be TextView. Most examples I have seen use the built-in id of android.R.id.text1, but I think you can define your own custom layouts too.

dave.c
  • 10,910
  • 5
  • 39
  • 62
  • It's a spinner. – Hell.Bent Dec 09 '10 at 19:01
  • I'm revisiting this code after a few months away from it.. but do think I'm off. I would think I'm need to first load URLs from android.provider.Browser.BookmarkColumns.URL to the adapter and then bind the adapter to the spinner. The ids are not coming from a textview, but rather URLs from my bookmarks. If anybody has any sample code that would be really appreciated. – Hell.Bent Dec 10 '10 at 15:22
  • Thank you! that was actually it. I have another related entry.. working on this thing every 6 months apparently.. whree now I can't seem to get the selected value. Thanks. – Hell.Bent Jul 28 '11 at 18:03