我收到了这个错误:
The method query(String, String[], String, String[], String, String, String) in the type SQLiteDatabase is not applicable for the arguments (String, String[], String, String, null, null, null)
和负责的代码:
public Cursor getDomanda(String id) {
List<categorie> categorie = new ArrayList<categorie>();
Cursor cursor = database.query(MySQLiteHelper.TABLE_SONDAGGI,
allCategorieColumns, MySQLiteHelper.COLUMN_ID + "=", id, null, null, null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
categorie categoria = cursorToCategorie(cursor);
categorie.add(categoria);
cursor.moveToNext();
}
// Make sure to close the cursor
// cursor.close();
return cursor;
}
另一方面:
long strcategory = getIntent().getExtras().getLong("categoriaId");
Cursor values = datasource.getDomanda(Long.toString(strcategory));
我做错了什么?我需要将 long 转换为,String[]
但到底是什么String[]
?:D 顺便说一句......查询对吗?我的意思是
database.query(MySQLiteHelper.TABLE_SONDAGGI,
allCategorieColumns, MySQLiteHelper.COLUMN_ID + "=", id, null, null, null);
是
select from tableSondaggi where _id = $id ?