diff options
author | 2010-09-24 08:40:48 -0700 | |
---|---|---|
committer | 2010-09-24 08:40:48 -0700 | |
commit | 760e7b24add964d16fd147484634166b99e57af2 (patch) | |
tree | e8497f776586eebda403ba8a3d08dea30ec44e81 /java/src | |
parent | 05ebb2e511f30a957926f89b8cc1df20bf1771e9 (diff) | |
parent | ca2fba71086b3832998ee9039723b66cce3be300 (diff) | |
download | latinime-760e7b24add964d16fd147484634166b99e57af2.tar.gz latinime-760e7b24add964d16fd147484634166b99e57af2.tar.xz latinime-760e7b24add964d16fd147484634166b99e57af2.zip |
am ca2fba71: am 6ee1bd42: Merge "Keep addWordToDictionary from doing disk I/O on main thread" into gingerbread
Merge commit 'ca2fba71086b3832998ee9039723b66cce3be300'
* commit 'ca2fba71086b3832998ee9039723b66cce3be300':
Keep addWordToDictionary from doing disk I/O on main thread
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/UserDictionary.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/UserDictionary.java b/java/src/com/android/inputmethod/latin/UserDictionary.java index 3315cf6c9..49b95e9aa 100644 --- a/java/src/com/android/inputmethod/latin/UserDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserDictionary.java @@ -89,13 +89,19 @@ public class UserDictionary extends ExpandableDictionary { super.addWord(word, frequency); // Update the user dictionary provider - ContentValues values = new ContentValues(5); + final ContentValues values = new ContentValues(5); values.put(Words.WORD, word); values.put(Words.FREQUENCY, frequency); values.put(Words.LOCALE, mLocale); values.put(Words.APP_ID, 0); - getContext().getContentResolver().insert(Words.CONTENT_URI, values); + final ContentResolver contentResolver = getContext().getContentResolver(); + new Thread("addWord") { + public void run() { + contentResolver.insert(Words.CONTENT_URI, values); + } + }.start(); + // In case the above does a synchronous callback of the change observer setRequiresReload(false); } |