代碼錯誤提示:
E/AndroidRuntime(1145): Caused by: android.database.sqlite.SQLiteException: near "*": syntax error: , while compiling: SELECT numbertype, new, duration, _id, numberlabel, name, number, type, date FROM calls WHERE (number = **9) ORDER BY date desc
解決:
查詢代碼改成:
總結:因為"*"為數據庫裡的關鍵字(未經證實),所有查找是會報語法錯誤,只需要拼接字符串,把"*"改成非關鍵字即可
ps:模擬器不知道為何直接拔打數字+"#"會清空屏幕,而只能撥打"#"開頭的號碼