【发布时间】:2016-04-02 14:56:31
【问题描述】:
我有一个包含内容提供商的数据库。数据库有 6 个表。我想列出所有表格。我使用加载器,现在我有一个CursorAdapter 用于一个运行良好的表。我没有找到传递变量来识别其他表的方法。每张桌子都需要CursorAdapter 吗?
这是我的 CursorAdapter 类代码:
public class extends ActivitiesAdapter CursorAdapter {
public ActivitiesAdapter (Context context) {
super (context, null, 0);
}
@Override
public void BindView (View view, Context context, Cursor cursor) {
TextView categ_list = (TextView) view.findViewById (R.id.categ_list_text);
categ_list.setText (cursor.getString (cursor.getColumnIndex (lajesContract.CategoriasEntry.CAT_CGT)));
}
@Override
View public Newview (Context context, Cursor cursor, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from (parent.getContext ());
inflater.inflate return (R.layout.item_layout, null, false);
}
}
如您所见,BindView 使用表 lajesContract.CategoriasEntry.CAT_CGT
我怎样才能通过其他表? 谢谢。
【问题讨论】: