i was working with a customised ListView and I’m Trying to get the email read/unread effect(i.e. Bold while read). Since I’m using cursor adapter I’m not able to crack it; Here’s my code
String[] from = new String[]
{
cursor.getColumnName(4),
cursor.getColumnName(3),
cursor.getColumnName(1),
cursor.getColumnName(2),
cursor.getColumnName(7),
cursor.getColumnName(o)
//,cursor.getColumnName(10)
//cursor.getColumnName(columnIndex)
};
int[] to = new int[]
{
R.id.pay_freq,
R.id.tax_period,
R.id.tax_date,
R.id.tax_year,
R.id.net_pay,
R.id.row_id
};
strGetReadorNot = cursor.getString(10);
if(strGetReadorNot.equals("0"))
{
setTypeface(null,Typeface.BOLD);
}
else
{
}
//Adapter used as interface between the widget and String array
adapters = new SimpleCursorAdapter(PayslipListActivity.this, R.layout.list_items,cursor, from, to);
setListAdapter(adapters);
Any help??
You have to use a custom CursorAdapter.
In
bindView()check if the email is read and set your textView’s typeface.