• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps DataBase to Spinner

Arigead

Lurker
Nov 24, 2009
5
0
There are a few threads in this forum on the subject of spinners but very few answers to most of the questions. I've searched the Internet and followed the android tutorial in [1] which basically implements a spinner on an array defined in an xml resource file. That works grand.

The next step is to work on a database table to select a number of options and select one of those. If the Database table is empty then perhaps the logical option is to have an additional "Add Category". This step is proving very difficult. I found an example [2] but this code will no run in the emulator and it doesn't give me any specific error it just informs me that the application has terminated unexpectedly.

From commenting out parts the line that's causing the problem is when the spin adapter is created. I've looked at the documentation for the spinadapter but it hasn't helped at all.

This strikes me as a fairly common design pattern and I'm sure somebody must have crossed this bridge? Anybody please and thanks in advance.

[1] Hello, Spinner | Android Developers

[2] Manually adding items to a Spinner linked to a Cursor :: anddev.org - Android Development Community | Android Tutorials
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones