2012-04-04 61 views
-1

我真的很努力与ListViewAdapter。我想从HttpGet获得一个字符串,并将其作为Listview中的一个项目呈现。在你问之前,我已经尽力了,而且我根本做不到。Android〜ListViewAdapter奋斗

非常感谢! :)

+1

悲伤,就知道.. – 2012-04-04 11:18:07

+1

发布我们的代码... – himanshu 2012-04-04 11:19:10

+0

你应该表现出你做了什么,从而使他人能凑合,使它的工作... – ngesh 2012-04-04 11:19:13

回答

1

将所有字符串存储到ArrayList<String>并将它们传递到适配器,并使用自定义列表ite,与TextView显示字符串。

ArrayList<String> result = new ArrayList<String>(); 
MyAdapter adapter = new MyAdapter(getBaseContext(), R.layout.list_item, result); 
listview.setAdapter(adapter); 

这是例如:ListView中的使用customAdaper Customizing Android ListView Items with Custom ArrayAdapter

+0

我不明白代码。 – TheBlueCat 2012-04-04 11:22:07

+0

查看我的更新回答.. – 2012-04-04 11:25:17

+0

我还是不明白。 – TheBlueCat 2012-04-04 21:06:10

0

的示例应用程序。

请参阅本LINK

+0

这只是一个硬编码字符串,我想我的列表视图是动态的。 – TheBlueCat 2012-04-04 11:26:20

+1

只需将动态数组列表替换为硬编码数组列表 – 2012-04-04 11:45:06