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
Post a Comment