在赋值语句中whereClString是否为真? 我需要的是从table中选择all =" tweetType"和Id =" userId"
String whereClString = LikeDatabaseHelper.TWEETS_TYPE + "=? AND " + LikeDatabaseHelper.USER_ID + "=?";
String[] args = new String[] { tweetType, String.valueOf(userId) };
try {
cursor = timelineDB.query(table, null, whereClString, args, null, null, LikeDatabaseHelper.TIME_COL
+ " DESC");
} catch (Exception e) {
e.printStackTrace();
}
return cursor;
答案 0 :(得分:0)
使用:
String whereClString = LikeDatabaseHelper.TWEETS_TYPE + "='" + tweetType.toString() + "' AND " + LikeDatabaseHelper.USER_ID + "='" + userId.toString() + "'" ;