如何从api网站提取数据?

时间:2015-11-27 16:24:01

标签: android json listview

我创建了一个应用程序,它打开了一个在线api(?)数据库。我使用了ListView小部件,其中每个条目(某物的名称)都点击了一个新活动。我想知道如何从数据库中提取数据并将其放入我的应用程序中;如果我得到关于页面上显示的洗发水的评论,还有洗发水的图片等。

对不起,如果我没有意义。

1 个答案:

答案 0 :(得分:0)

It would have helped if you post some of your code. 
According to what I understood is that you want to download data from server and show it into your list view.

What you can do is you can hit API in Asynctask. Put each item data like text, image URL etc into one bean class (setter getter) and add that bean into your list attached to your adapter.

Then you can call notifyDataSetChanged() on your adapter.