解决方案 »

  1.   

    你这也太纠结了吧! 不用这么麻烦String sql = " select * from table where ' "+ con+ " '  like  ?  ";
      

  2.   

    可能是:"'%' + con + '%'",外面是双引号,内面是单引号。
    还可以这么写:Cursor cursor=db.query(TABLE_NAME, null, col+" like ?", new String[]{"%"+con+"%"}, null, null, null);
      

  3.   

    这样写明显有错误嘛,一个双引号里面的值代表string数组里面的一个值
      

  4.   

    晕, 其实"'%" + con + "%'" 里面不用加单引号的 
    我调试的时候一直关注cursor.mcount 可里面总是-1,导致我总以为出错,其实是正常的,
    用cursor.getCount()获得的数据正常,可为什么cursor.mcount 就是-1,我到现在还不明白
    不知道有没有高手指点?