以下代码摘自《Android应用开发详解》18章:
private void setTableAdapter(){
// 访问本地SQLite数据库中桌号表的Uri
Uri uri = Uri.parse("content://com.amaker.provider.TABLES/table");
// 要选择桌号表中的列
String[] projection = { "_id", "num", "description" };
// 查询放回游标
Cursor c = managedQuery(uri, projection, null, null, null);
// 实例化桌号下拉列表Spinner的Adapter
SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, c,
new String[] { "_id" }, new int[] { android.R.id.text1 });
// 为桌号Spinner绑定数据
tableNoSpinner.setAdapter(adapter2);
}
哪位高手帮我分析分析上面的uri,com.amaker.provider.TABLES是指的什么,/table指的是什么?
我想在sqlite建一张表,表名是指上面URI的哪一部分?
private void setTableAdapter(){
// 访问本地SQLite数据库中桌号表的Uri
Uri uri = Uri.parse("content://com.amaker.provider.TABLES/table");
// 要选择桌号表中的列
String[] projection = { "_id", "num", "description" };
// 查询放回游标
Cursor c = managedQuery(uri, projection, null, null, null);
// 实例化桌号下拉列表Spinner的Adapter
SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, c,
new String[] { "_id" }, new int[] { android.R.id.text1 });
// 为桌号Spinner绑定数据
tableNoSpinner.setAdapter(adapter2);
}
哪位高手帮我分析分析上面的uri,com.amaker.provider.TABLES是指的什么,/table指的是什么?
我想在sqlite建一张表,表名是指上面URI的哪一部分?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货