如何确定用户是否已为产品付款,现在他有权使用该产品?
答案 0 :(得分:1)
使用游标将数据存储到列表中,并将该列表传递给适配器。要将数据放入列表,请参阅以下代码:
List<String> myList = new ArrayList<String>();
if (cursor.moveToFirst()) {
do {
myList.add(cursor.getString(0));
}while (cursor.moveToNext());
}
答案 1 :(得分:0)
String[] from = {"column"};
int[] to = new int[] {android.R.id.text1};
SimpleCursorAdapter adapter = new SimpleCursorAdapter(context,
android.R.layout.simple_list_item_1,
cursor,
from,
to,
0);
listView.setAdapter(adapter);