android在listview中用TBD替换空值

时间:2011-10-19 20:12:14

标签: android

SimpleCursorAdapter adapter = new SimpleCursorAdapter (this, R.layout.mytaskslayout, cursor, new String[] {"Aircraft","Discrepancy", "ARR_FLT", "ARR_Gate", "DPT_FLT", "DPT_Gate"}, new int[] {R.id.ac, R.id.discrepancy, R.id.arrac, R.id.arrgate, R.id.dptac, R.id.dptgate});

这里有些值为null。我不想显示null但是TBD。我能在这做点什么吗(我不能改变SQL)

1 个答案:

答案 0 :(得分:0)

遍历你的数组(填充listview),数组中任何等于null的值使它等于TBD

但是我看到你动态创建数组而不是数据库

new String[] {"Aircraft","Discrepancy", "ARR_FLT", "ARR_Gate", "DPT_FLT", "DPT_Gate"}, new int[] {R.id.ac, R.id.discrepancy, R.id.arrac, R.id.arrgate, R.id.dptac, R.id.dptgate}