In my application i am showing data from database in a listview.In that listview 1 particular text view should be dynamic(i.e) based on one column value that particular textview should change,
Following are my full structure of database:
http://www.freeimagehosting.net/bmcrp
http://www.freeimagehosting.net/8f13z
.In that if reccurence is “true” means textview 9 should show recctotal otherwise total.
My code is as follows:
Cursor c = db.getExpensetitle(intent.getStringExtra("grpsdbexp"));
startManagingCursor(c);
-------------------->Here i have to use the condition.
from = new String[] {db.KEY_DATE,db.KEY_DESC,db.KEY_INCOME,db.KEY_QUANTITY,db.KEY_TOTAL,db.KEY_ROWID};
to = new int[] {R.id.text1 ,R.id.text3,R.id.text5,R.id.text7,R.id.text9,R.id.text11};
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.columnviewexp, c, from, to);
lv.setAdapter(notes);
Please help me.Thanks in advance.
As there is a condition, you should custom cursor adapter instead of SimpleCursorAdapter.
https://codereview.stackexchange.com/questions/1057/android-custom-cursoradapter-design