Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Contributor
dakdroid
Posts: 14
Registered: ‎11-17-2012
My Device: -
My Carrier: -

UserDictionary seems to be empty

[ Edited ]

I added a few word in the emulator:

Setting->Language&Inuput->Spell Check->Edit Personal Dictionary

 

Now I need to pick words from the UserDictionary:

 

 

ContentResolver resolver = getContentResolver();
		final String[] QUERY_PROJECTION = {
				  UserDictionary.Words._ID,
				  UserDictionary.Words.WORD
				};
		Cursor cursor = resolver.query(UserDictionary.Words.CONTENT_URI, QUERY_PROJECTION, "(locale IS NULL) or (locale=?)", 
	            new String[] { Locale.getDefault().toString() }, null);

 Then I loop through it:

int count=0;
while (cursor.moveToNext()) {

String word = cursor.getString(cursor
.getColumnIndex(UserDictionary.Words.WORD));
count++;
}

 And then count returns 0.

 

Please use plain text.