Android的源码,微调:) [英] Android, sqlite,spinner :)

查看:73
本文介绍了Android的源码,微调:)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/2196426/populating-spinner-from-sqlite-database-android">Populating微调从SQLite数据库Android的

我想用2纺纱厂和一个EditText上在我的Andr​​oid项目。

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

第一微调包括国家 第二微调包括城市,但它应该受到第一微调的选择。

The first spinner includes "Countries" The second spinner includes "Cities" but it should be affected by first spinner selection.

那么,如果我选择第二微调任何国家我想给在editext

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

我该怎么办呢?我知道我必须使用SQLite,并创建一个表,但我知道逻辑的事情,但我不能写在Eclipse中的code ..

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..

推荐答案

请看看这个例子从Android开发者网站;

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

<一个href="http://developer.android.com/resources/samples/Spinner/src/com/android/example/spinner/SpinnerActivity.html" rel="nofollow">http://developer.android.com/resources/samples/Spinner/src/com/android/example/spinner/SpinnerActivity.html

您需要设置一个OnItemSelectedListener每个纱厂和onItemSelected(),你应该能够得到微调值和更新其他微调/ EditText上。

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.

干杯, ^ h

这篇关于Android的源码,微调:)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆