0

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

Manuel
  • 1
  • 1
  • It sounds like you got the logic correct, but you need to be more specific. What's the failure you're experiencing? Is the data being downloaded correctly? Or is it that nothing is showing up in your listview? Have you tried your debugger and putting Logcat statements in the code to see where its going wrong? – Android Noob Jun 29 '13 at 18:46

1 Answers1

0

Sounds about right. You can always code a simple activity with no input and just a listview to get a feeling of how the data retrieval cycle works and test your comprehension.

dmon
  • 30,048
  • 8
  • 87
  • 96