• data1是字符串?需要加上引号


    07-22 15:55:29.832: E/AndroidRuntime(23914): FATAL EXCEPTION: main
    07-22 15:55:29.832: E/AndroidRuntime(23914): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x11ba958
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:180)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.content.ContentResolver.query(ContentResolver.java:311)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at com.txrj.sms.manager.SmsDataManager.getNameByAddress(SmsDataManager.java:139)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at com.txrj.sms.activity.ShowSmsActivity$1.handleMessage(ShowSmsActivity.java:41)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.os.Handler.dispatchMessage(Handler.java:99)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.os.Looper.loop(Looper.java:137)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at android.app.ActivityThread.main(ActivityThread.java:4517)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at java.lang.reflect.Method.invokeNative(Native Method)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at java.lang.reflect.Method.invoke(Method.java:511)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
    07-22 15:55:29.832: E/AndroidRuntime(23914):     at dalvik.system.NativeStart.main(Native Method)

     

    07-22 16:01:08.913: E/AndroidRuntime(24385): FATAL EXCEPTION: main
    07-22 16:01:08.913: E/AndroidRuntime(24385): android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT DISTINCT display_name FROM view_data_restricted data WHERE (1) AND ((mimetype='?' and data1=?-))  // data1是字符串?需要加上引号
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:180)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.content.ContentResolver.query(ContentResolver.java:311)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at com.txrj.sms.manager.SmsDataManager.getNameByAddress(SmsDataManager.java:139)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at com.txrj.sms.activity.ShowSmsActivity$1.handleMessage(ShowSmsActivity.java:41)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.os.Handler.dispatchMessage(Handler.java:99)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.os.Looper.loop(Looper.java:137)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at android.app.ActivityThread.main(ActivityThread.java:4517)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at java.lang.reflect.Method.invokeNative(Native Method)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at java.lang.reflect.Method.invoke(Method.java:511)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
    07-22 16:01:08.913: E/AndroidRuntime(24385):     at dalvik.system.NativeStart.main(Native Method)

  • 相关阅读:
    文件进阶
    文件及文件操作
    字符编码
    集合
    数据类型之字典
    数据类型之列表,元组
    数据类型之数字,字符串
    for 循环语句
    while 循环语句
    深浅拷贝
  • 原文地址:https://www.cnblogs.com/fengzhblog/p/3207854.html
Copyright © 2020-2023  润新知