Code example for SimpleCursorAdapter

Methods: setDropDownViewResource

0
	 * @param c 
	 * @param from 
	 * @return a SpinnerAdapter based on Cursor parameter 
	 */ 
	protected SpinnerAdapter createSpinnerCursorAdapter(Cursor c, String from) {
		SimpleCursorAdapter adapter = new SimpleCursorAdapter(ctx, android.R.layout.simple_spinner_item,
				c, new String[]{from}, new int[]{android.R.id.text1});
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		return adapter;
	} 
	 
	public void setAdapter(Cursor c, String from) {
		// Close previous cursor 
		closeAdapterCursor(); 
		 
		spinner.setAdapter(createSpinnerCursorAdapter(c, from));
		spinner.setEnabled(c != null && c.getCount() > 1);
	} 
	 
	public void closeAdapterCursor() { 
		try {