在Android中更新我的ListView

在Android中更新我的ListView,android,listview,android-listview,Android,Listview,Android Listview,你好,我想更新我的Listview 我有一个Listview,它只包含一个TextView 这是我填写列表视图的方式: lView=(ListView)findViewById(R.id.ListView) 从适配器获取项目,更改其数据,并告诉适配器发生了更改 int index = 0; String item = adapter.get(index); item = "my new string"; adapter.notifyDataSetChanged(); 这都是来自的,我将尝试一下

你好,我想更新我的Listview

我有一个Listview,它只包含一个TextView

这是我填写列表视图的方式:

lView=(ListView)findViewById(R.id.ListView)


从适配器获取项目,更改其数据,并告诉适配器发生了更改

int index = 0;
String item = adapter.get(index);
item = "my new string";
adapter.notifyDataSetChanged();

这都是来自

的,我将尝试一下。。。我已经准备好用adapter.getItem(Position)获取文本视图,但是它给了我一个字符串,我想这也是我在考虑它时可以使用lol的东西是的,adapter提供数据。如果您想要视图,您可能必须自己实现适配器。检查api:)不起作用没有get()方法,但我想你指的是getItem…不过我看不到任何东西listview只是空白我认为字符串的更改全部是jsut LOCAL OK我现在明白了:检查我编辑的答案!我会给你的答案打分:)
    stringArray[0]=newString;
    adapter.notifyDataSetChanged();
int index = 0;
String item = adapter.get(index);
item = "my new string";
adapter.notifyDataSetChanged();