In my applicatio i have 1 listview,filling data from database using arrayadapter.
Here is following code:
public void onClick(View v) {
// TODO Auto-generated method stub
Cursor c = db.gethouseholdTitle();
startManagingCursor(c);
// if(cat.equals("Income"))
// {
//// System.out.println("inside if="+select);
//// Cursor cin = db.income();
String[] fromdes = new String[] {db.KEY_DATE,db.KEY_DESC,db.KEY_INCOME,db.KEY_TOTAL};
int[] todes = new int[] {R.id.text1 ,R.id.text3,R.id.text5,R.id.text7};
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.columnview, c, fromdes, todes);
// System.out.println("notes="+notes.getCount());
// setListAdapter(notes);
lv.setAdapter(notes);
}
But showing error:
The constructor SimpleCursorAdapter(new View.OnClickListener(){}, int, Cursor, String[], int[]) is undefined
What i am doing wrong.Thanks in advance.I think we cant able to fill cursor adapter inside a click function??