Code example for SimpleCursorAdapter

Methods: setAdapter

0
		super.onCreate(savedInstanceState);
 
		db = new MyDatabase(this);
		employees = db.getEmployees(); // you would not typically call this on the main thread
 
		ListAdapter adapter = new SimpleCursorAdapter(this, 
				android.R.layout.simple_list_item_1, 
				employees, 
				new String[] {"FullName"}, 
				new int[] {android.R.id.text1});
 
		getListView().setAdapter(adapter);
	} 
 
	@Override 
	protected void onDestroy() { 
		super.onDestroy(); 
		employees.close();
		db.close();
	}