我已经尝试了本网站中讨论将数据绑定到TextView的所有示例,但没有解决我的问题。绑定到TextView
我有一个数据库,并TextView的,我用一个简单的鼠标适配器
MyDataBase mDB = new MyDataBase(this);
Cursor cursor = mDB.all(this);
String[] from = new String[] {mDB.VALUE};
int[] to = new int[] {R.id.text1View1};
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.main, cursor, from , to);
adapter.setViewBinder(new myViewBinder());
,并在这里一起绑定它们是myViewBinder
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
TextView txtWelcome = (TextView) view;
String name = cursor.getString(VALUE_ID);
txtWelcome.setText(name);
}
的代码,任何一个可以帮助我了解为什么午餐时的主要活动没有变化? 我需要添加哪些额外的代码?