This is my headache!
My app is a language dictionary. Its database is stored in the SQLite database saved in SDcard. I assume when a user like a word s/he will save it to the Favourite list. I decide to code to save such favourite words to the XML file (SharedPreferences) in which they appear like the below:
<string name="favourite">dict_name::149271::go,dict_name::25481::back,dict_name::184774::jet</string>
<boolean name="saveFavourite" value="true" />
The string "favourite" begins with the dictionary name
(database name), then the word ID
(number), and the word
itself. The Favourite list is successfully displayed as illustrated in the image below.
I use the following code to bind the Favourite items with their definitions in the SQLite database:
mLSTFavourite.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
public void onItemClick(AdapterView<?> listView, View itemView, int itemPosition, long itemId)
{
Intent launchActivity = new Intent(FavouriteView.this, ContentView.class);
startActivity(launchActivity);
}
});
But the problem is that the app cannot find out the definition of each of the words in the shown Favourite list.
I want the definition of the word (item) in the Favourite list to be displayed when it is clicked. What should I do now?
Can you guys give a little help?
Thank you very much.