android - How to check if the word is already available in user dictionary? -


i need simple , elegant way (having word) check whether given word available in user dictionary or not. word frequency doesn't matter, locale does.

is there simpler querying contentresolver iterating , checking cursor.getstring(index_word).equals(myword)?

you should create query, search word in userdictionary:

getcontentresolver().query(userdictionary.words.content_uri,      new string[]{userdictionary.words._id, userdictionary.words.word},      //selection      userdictionary.words.word +" = ?",      //selection args      new string[]{myword}, null); 

than can check cursor :

if(cursor.getcount()==0){      //word not in dictionary } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -