1
SQLiteDatabase myDatabase = openOrCreateDatabase("SMDB", MODE_PRIVATE, null);
Cursor c = myDatabase.rawQuery("SELECT PName FROM tbl_staff WHERE PMajor LIKE '%" + selectedItemFromSpin + "%'", null);
c.moveToFirst();

This is my code, now this code works fine when I pass an English Word for selectedItemFromSpin variable but when I send a non English word like "نوشته مثال" then app crashes and says a message with button named force to quit.


I appreciate if anyone helps.

4

1 回答 1

0

cursor = db.rawQuery(query, new String[]{"%"+selectionArgs[0]+"%","%"+selectionArgs[2]+ "%"});

于 2015-05-06T07:33:31.487 回答