没有仅以字符串作为参数的查询方法,您必须在方法中传递所有参数,如下所述
public JSONArray getSavedMeasuremnet() {
JSONArray jsonArray=new JSONArray();
SQLiteDatabase db = this.getWritableDatabase();
Cursor mCursor = db.rawQuery("SELECT * FROM TableB JOIN TableA ON TableA.ADTid == TableB.ADTid where TableA.ADTMeasurement='measurement'",null)
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
try {
JSONObject jsonObject=new JSONObject();
jsonObject.put("ADTName",cursor.getString(cursor.getColumnIndex("ADTName")));
jsonObject.put("ADTid",cursor.getString(cursor.getColumnIndex("ADTid")));
jsonObject.put("ADTType",cursor.getString(cursor.getColumnIndex("ADTType")));
jsonArray.put(jsonObject);
} catch (JSONException e) {
e.printStackTrace();
}
cursor.moveToNext();
}
return jsonArray;
}