【问题标题】:Compilation error in getting Cursor using sqlcipher使用 sqlcipher 获取 Cursor 时出现编译错误
【发布时间】:2015-04-18 10:41:56
【问题描述】:

我是 android 编程新手。在我的应用程序中,我想使用 sqlcipher 加密数据库,但遇到编译错误。请帮助解决这个问题,因为我已经搜索了很多但找不到解决方案。 已经完成了 sqlcipher 所需的导入并使用 SQLiteDatabase.loadLibs(this) 加载了库。

提前谢谢..! [附上代码]

@Override

public void onActivityResult(int reqCode, int resultCode, Intent data)

    super.onActivityResult(reqCode, resultCode, data);

    String name="",phoneNumber="";

    switch (reqCode) {
        case (PICK_CONTACT):
            if (resultCode == Activity.RESULT_OK) {

               Uri contactUri = data.getData();


   Cursor c = getContentResolver().query(contactUri,null, null, null,null);

在最后一行出现错误:不兼容的类型: 必需:net.sqlcipher.Cursor 找到:android.database.Cursor

【问题讨论】:

    标签: android cursor sqlcipher


    【解决方案1】:

    您在使用 SQLCipher 时导入了错误的包以引用 Cursor 接口。查看文件顶部的导入语句,将android.database.Cursor 替换为net.sqlcipher.Cursor。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-19
      • 2013-06-16
      • 2013-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多