我在sqlite
数据库中从我的表的2列中获取了2个数组。
1 - Group ID
2 - Group Name
我希望使用群组名称创建Navigation Drawer
,当用户点击每个项目时,我可以从位置/ ID获取Group ID
final SQLiteDatabase mydatabase = openOrCreateDatabase("CopyCollection", MODE_PRIVATE, null);
Cursor crs = mydatabase.rawQuery("SELECT * FROM Groups WHERE ID != 1",null);
String[] array = new String[crs.getCount()];
String[] arrayID = new String[crs.getCount()];
int i = 0;
while(crs.moveToNext()){
String uname = crs.getString(crs.getColumnIndex("GroupName"));
String id = crs.getString(crs.getColumnIndex("ID"));
array[i] = uname;
arrayID[i] = id;
i++;
现在我有2个阵列,但我不知道如何在导航抽屉中设置
public void onItemClick(AdapterView<?> parent, View view, final int pos, final long id){