I'm trying to do the following in Android:
- In my SearchActivity, I have a SearchView in the actionbar and below a ListView, where the results or a empty list should be shown.
- With the query of the SearchView, I will perform a search (Amazon API) which results in a ArrayList of different articles.
- Then each article should be displayed as a separate row in the listView of the SearchActivity
How can I realize that? I tried it different ways with AsyncTask and a custom adapter, also with an ArrayAdapter ... unfortunalety, without success ... Here I particularly lack a sense for where the objects are passed to other classes
As far as i get it right now, the SearchActivity should call the AsyncTask with the "execute(query)" command. "doInBackground" should download the stuff and put it into the ArrayList and with the command "onPostExecute" the new view (listView) should be established. Or am I totally wrong?
I would appreciate it very much if someone can help me :)
Greetings, Manuel