android下拉框默认文字,android给下拉框设置默认选中值,定义staticfinalMap

《android给下拉框设置默认选中值,定义staticfinalMap》由会员分享,可在线阅读,更多相关《android给下拉框设置默认选中值,定义staticfinalMap(3页珍藏版)》请在人人文库网上搜索。

1、给下拉框设置默认选中值,定义static final MapSpinner city_spr = (Sp inner) fin dViewByld(R.id.Spi nn er01);ArrayAdaptervStr ing adapter =new ArrayAdaptervStri ng(this ,an droid.R.layout.simple_sp inn er_item,Con stData.city);adapter.setDropDow nViewResource(a ndroid.R.layout.simple_sp inn er_dropdow ntem);city_spr。

2、.setAdapter(adapter);city spr.setSelectio n(C on stData.citymap .get(深圳);定义 static final MapSuppressWarnings( serial )citymap = newpublic static final Map HashMapvStri ng,l nteger()put(北京,0);put(上海,1);put(天津,2);put(重庆,3);put(唐山 ” ,4);put(石家庄 ” ,5);put(大连,6);put(哈尔滨 “ ,7);put(海口 ,8);put(长春,9);put(长沙,。

3、10);put(成都,11);put(福州,12);put(广州,13);put(贵阳,14);put(杭州,15);put(合肥,16);put(呼和浩特“ ,17);put(济南,18);put(昆明,19);put(拉萨,20);put(兰州,21);put(南昌,22);put(南京,23);put(南宁,24);put(青岛,25);put(深圳,26);put(沈阳,27);put(太原,28);put(乌鲁木齐,29);put(武汉,30);put(西安 “ ,31);put(西宁,32);put(厦门,33);put(徐州,34);put(银川,35);put(郑州,36);其。

4、他方法方法一public static final Map routes =new HashMap() put(/acco un t, new Acco un tHa ndler();put(/feed, new FeedHa ndler();put(/opml, new OpmlHandler();方法二import java.util.*;public class Router public static final Map routes;static Map map = new HashMap();map.put(/acco un t, new Acco un tHa ndler();map.put(/feed, new FeedHa ndler();map.put(/opml, new OpmlHa ndler();routes = Collect ions.unm odifiableMap(map);方法三public static fin al Map ERS_TYPE_MODEL_TYPE = new HashMap();staticERS_TYPE_MODEL_TYPE.put(0,ERS_TYPE_M0DEL_TYPE.put(1,ERS_TYPE_M0DEL_TYPE.put(2,整机件”); 零部件); 软件。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值