Android 每张桌子都需要游标适配器吗?

Android 每张桌子都需要游标适配器吗?,android,database,listview,Android,Database,Listview,我有一个带有内容提供商的数据库。数据库有6个表。我想列出所有的表格。我使用加载器,现在我有一个CursorAdapter,用于一个工作良好的表。我没有找到传递变量以标识其他表的方法。每个表是否需要CursorAdapter? 这是我的游标适配器类代码: public class extends ActivitiesAdapter CursorAdapter { public ActivitiesAdapter (Context context) { super (context,

我有一个带有内容提供商的数据库。数据库有6个表。我想列出所有的表格。我使用加载器,现在我有一个
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
用表lajescompact.CategoriasEntry.CAT\u CGT中的数据填充列表

我怎样才能通过其他桌子?
谢谢。

是的,您应该为每个表创建一个单独的适配器


您可能会考虑到这些共性,但这正是CursorAdapter所做的。进一步尝试重用适配器只会创建过于复杂、脆弱的代码,没有任何实际好处。

谢谢您的回答。很清楚。我会继续工作。