my question might be a little too unspecific, but maybe someone can give me a small hint. I am currently working on a little vocabulary trainer on android. It is my first android app and more or less only for training purposes. The user can basically add new vocabulary, change existing ones and learn available words. The learning part includes the following steps:
- Get all available vocabulary from the database
- Select randomly three words
- Select randomly one word as the correct one
- Display the correct word in a TextView and the german translations of all three selected words on Buttons
- User pushes one button
- App checks if the pushed button belongs to the correct translation, goto step 2.
The app is basically working fine, but I get a lot of "The application may be doing too much work on its main thread." warnings. I suppose that these warnings are displayed because I only use the main thread for getting the words from the database, selecting words and so on. I am familiar with the concept of multithreading, but actually I have no idea how to use it here:
- My app has to execute the above steps in this order because it is senseless when the user for example pushes a button before the words are displayed.
- When I use an AsyncTask, I don't know how to get the selected correct word in order to compare it to the user selection.
Any help and tipp is appreciated. Thanks in advance!