简体   繁体   English

Android Spinner 以编程方式加载

[英]Android Spinner programmatically load

In my android APP I have 3 spinners.在我的 android APP 中,我有 3 个微调器。 When I select an item from Spinner 1 according to that selection Spinner 2 data will be loaded.当我 select 根据该选择 Spinner 2 数据将加载来自 Spinner 1 的项目时。 And When I select an item from Spinner 2 according to that selection Spinner 3 data will be loaded.并且当我 select 根据该选择 Spinner 3 数据将加载来自 Spinner 2 的项目时。 That process is working.该过程正在发挥作用。 But I want to reloaded the same selections when I come back to the same activity from another activity.但是当我从另一个活动返回到同一个活动时,我想重新加载相同的选择。 I have the selected values on session.我在 session 上有选定的值。 I just want to reload the spinners and select the previous values so user don't have to go through selection process again.我只想重新加载微调器和 select 以前的值,这样用户就不必再次通过选择过程来 go 了。 How I can achieve this.我怎么能做到这一点。

With this command you can update it: adapter.notifyDataSetChanged();使用这个命令你可以更新它: adapter.notifyDataSetChanged();

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

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