如何在列表视图中绑定xml数据 [英] how to bind xml data in listview

查看:90
本文介绍了如何在列表视图中绑定xml数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经启用了功能

i have made afunction

fetchData()
{
  ArrayList<moviedata> objMoviedata = null;

...
...
...
}


提取xml数据并存储在ArrayList< moviedata>
一切正常,现在我想将此数据绑定到列表视图中,
所以任何人都可以帮忙吗,
在此先感谢您的任何建议.


to fetch xml data and storing in ArrayList<moviedata>
which is working fine,now i want to bind this data in listview,
so can anybody please help,
Thanks in advance,for any suggestion.

推荐答案

在这里,我给出两件事.
那是:
1.从xml文件中获取String数组数据
2.将数据绑定到listView

尝试此代码..

Here i give two things.
That are :
1. Get String array data from xml file
2. Bind the data into listView

Try this Code..

ArrayAdapter<charsequence> adp=ArrayAdapter.createFromResource(this,
                R.array.str, android.R.layout.simple_list_item_1);
adp.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
list.setAdapter(adp);</charsequence>


这篇关于如何在列表视图中绑定xml数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆