开发者

Android, sqlite,spinner :) [duplicate]

开发者 https://www.devze.com 2023-03-04 00:07 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Populating Spinner From SQLite Database Android
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Populating Spinner From SQLite Database Android

I want to use 2 spinners and one edittext in my Android project.

The first spinner includes "Co开发者_如何学运维untries" The second spinner includes "Cities" but it should be affected by first spinner selection.

Then if i choose any countries from second spinner i want to give some information in "editext"

How i can do it? I know I have to use SQLite and create a table, but I know the logical things but I couldn't write the code on Eclipse..


Please have a look at this example from the Android Developer site;

http://developer.android.com/resources/samples/Spinner/src/com/android/example/spinner/SpinnerActivity.html

You need to set an OnItemSelectedListener for each of the Spinners and in onItemSelected() you should be able to get the spinner value and update the other Spinner/EditText.

Cheers, H

0

精彩评论

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