想要一个简单的代码来获取州名称和城市名称取决于选择
我对 android 和 java 都是新手。我正在开发一个简单的应用程序,其中包含由微调器选择的国家、州和城市。现在考虑在选择国家(印度)时我只需要获取印度的州。然后,当选择任何州(安得拉邦)时,美联社的城市应显示在下一个旋转器中。任何人都可以建议我一些示例代码吗?
提前致谢
I am new to both android and java. I am developing a simple app which contain country , state and city which are selected by spinner. Now consider while am selecting the country(India) then i need to get only states of india. And then while selecting any state(Andhra pradesh) then the cities of A.P should be shown in the next spinner. Can any one suggest me with some sample code.
thanks in advance
您可以将此逻辑(对于两个旋转器)添加到您的代码中:
...
}
you can add this logic(for two spinners) to your code:
....
}