简体   繁体   English

从数据库中选取数据时的动态列表视图或文本视图

[英]Dynamic listview or text view when data is picked from database

I'm new to android development and stuck somewhere. 我是android开发的新手,并停留在某个地方。 Can anybody please help me to understand eg :- if there is a list view of 3 fruits and we want to fetch dynamically 50 different fruits name in a list view or text view. 谁能帮我理解例如:-如果有3种水果的列表视图,而我们想在列表视图或文本视图中动态获取50种不同的水果名称。

Could somebody please help me with the code for regarding the above 有人可以帮我提供有关上述内容的代码吗

The ListView will update dynamically with the collection of data(can be array, arraylist) you pass to adapter. ListView将随着传递给适配器的数据集合(可以是array,arraylist)动态更新。 fetch data and update your array, 获取数据并更新您的阵列,

call, adapter.notifyDataSetChanged(); 调用,adapter.notifyDataSetChanged();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM