开发者

Implement List with value and text?

开发者 https://www.devze.com 2023-03-30 12:26 出处:网络
i am new to android. I have some doubt with list. I need to create a list dynamically from one the xml file.

i am new to android. I have some doubt with list. I need to create a list dynamically from one the xml file. The xml contains the format something like <location id ="some_id" label="label">(like <option> i开发者_运维技巧n html). How can i represent this with list(or any other option. the locations should look like a list and i want to select this locations). This id is used when the data is save back in server. I tried with list but cant get

thanks.


there are 2 parts to this

first, you need to either parse your xml file, or change the format to include it in the resources of the project as a string array (for instance) in your values.xml file

second, you need to set an alert with items corresponding to your values. see http://malsandroid.blogspot.com/2010/04/list-picker-and-fading-popup-notice.html

0

精彩评论

暂无评论...
验证码 换一张
取 消