开发者

Android how to display the contents from array in simple method?

开发者 https://www.devze.com 2023-03-25 00:12 出处:网络
i\'m trying to list the item in array using listactivity but the contents are in server, and also i need to get that val开发者_运维百科ues to array and display that in listview. Can anyone know this m

i'm trying to list the item in array using listactivity but the contents are in server, and also i need to get that val开发者_运维百科ues to array and display that in listview. Can anyone know this method?


To show data from an array in a list view, you need to use an array adapter:

http://developer.android.com/reference/android/widget/ArrayAdapter.html


For that you need to implement web service call , retrieve the response from the same and then need to parse it either by using XML PullParser, SAX Parser, DOM Parser. Once you are done with parsing the response, you just need to display it inside the ListView or whatever you wants.


Try using:

echo '<pre>'.print_r($array, TRUE).'</pre>';

Where $array is your array.

0

精彩评论

暂无评论...
验证码 换一张
取 消