Tag: 非法状态

非法StateException错误

我最近从Java迁移到Kotlin,并将我的应用程序的代码转换为kotlin代码并发布了更改。但是现在有些用户报告说应用程序正在强制停止。 但是我和被测设备都没有面临这个问题。 当我检查崩溃页面。 它显示了这一点: 这是1018行的DatabaseHelper Class Code fun getNotes(sqlCommand: String): MutableList { val result = ArrayList() val db = this.readableDatabase Log.e(LOG, sqlCommand) val cursor = db.rawQuery(sqlCommand, null) try { if (cursor!!.moveToFirst()) { do { val note = Note() note.id = cursor.getLong(cursor.getColumnIndex(KEY_ID)) note.title = DataEncryption.encryptDecrypt(cursor.getString(cursor.getColumnIndex(KEY_TITLE))) note.content = DataEncryption.encryptDecrypt(cursor.getString(cursor.getColumnIndex(KEY_CONTENT))) note.updatedAt = Date(cursor.getLong(cursor.getColumnIndex(KEY_UPDATED_AT))) note.color = cursor.getInt(cursor.getColumnIndex(KEY_COLOR)) note.favourite = […]