I have a db with table \"mytable\" having 2 colums \"id\",\"sampletext\" I want to query distinct values of sampletext and feed to a Spinner using SimpleCursorAdapter.
android.widget.SimpleCursorAdapter adapter = new android.widget.SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cursor, new String[] { DBOpenHelper.ACCOUNT_BANK }, new int[] { android.R.id.text1 }, 0); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);