Android Spinner not being populated by SQLite table?

Try this code It works for me AdapterCountries = new ArrayAdapter(this, android.R.layout. Simple_spinner_item); AdapterCountries . SetDropDownViewResource(android.R.layout.

Simple_spinner_dropdown_item); spin. SetAdapter(AdapterCountries); spin. SetOnItemSelectedListener(new MyOnItemSelectedListener()); allElementDetails.clear(); db1.open(); // long id; Cursor cursor = db1.

GetAllTitles1(); while (cursor.moveToNext()) { results=cursor. GetString(2); AdapterCountries. Add(results); } db1.close() In My Adapter class public Cursor getAllTitles1() { return db.

Query(DATABASE_TABLE1, new String { KEY_ROWID, DISHNAME, CATEGORY, DESCRIPTION, IMAGE}, null, null, null, null, null); }.

Try this code. It works for me. AdapterCountries = new ArrayAdapter(this, android.R.layout.

Simple_spinner_item); AdapterCountries . SetDropDownViewResource(android.R.layout. Simple_spinner_dropdown_item); spin.

SetAdapter(AdapterCountries); spin. SetOnItemSelectedListener(new MyOnItemSelectedListener()); allElementDetails.clear(); db1.open(); // long id; Cursor cursor = db1. GetAllTitles1(); while (cursor.moveToNext()) { results=cursor.

GetString(2); AdapterCountries. Add(results); } db1.close(); In My Adapter class public Cursor getAllTitles1() { return db. Query(DATABASE_TABLE1, new String { KEY_ROWID, DISHNAME, CATEGORY, DESCRIPTION, IMAGE}, null, null, null, null, null); }.

Spinner spinner = (Spinner) findViewById(R.id. Int firstnameColumnIndex = c. // boolean result = super.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions