这是我的数据库处理程序代码..
// Getting All detail
public List<Detail> getAllDetail() {
List<Detail> detailList = new ArrayList<Detail>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_DETAIL;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
Detail detail = new Detail();
detail.setID(Integer.parseInt(cursor.getString(0)));
detail.setTitle(cursor.getString(1));
detail.setDetail(cursor.getString(2));
// Adding contact to list
detailList.add(detail);
} while (cursor.moveToNext());
}
我需要在一个活动类中检索这些细节,它的布局文件看起来像一个带有这样的按钮的列表视图..
该按钮应该被分配数据库行的ID..单击它应该转到另一个活动,在该活动中可以完全查看特定行的详细信息..
请帮助我..提前谢谢..