0

I have a couple of input types and each has its own words in the personal dictionary (UserDictionary). I want to delete a word(s) from one input type/ one locale.

I tried the following but the app crashes:

getContentResolver().delete(UserDictionary.Words.CONTENT_URI,
UserDictionary.Words.LOCALE + " = en_US", null);

The error says:

android.database.sqlite.SQLiteException: no such column: en_US (code 1): , while compiling: DELETE FROM words WHERE locale = en_US

Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110
  • 1
    Please note that many keyboard apps keep their own dictionaries, rather than using the system one. There is nothing you can do programmatically to remove it from there. – Gabe Sechan Jun 22 '18 at 20:35

1 Answers1

0

The syntax was wrong. The correct syntax is as following:

getContentResolver().delete(UserDictionary.Words.CONTENT_URI,
UserDictionary.Words.LOCALE + "=?", new String[] {"en_US"});
Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110