码迷,mamicode.com
首页 > 其他好文 > 详细

高德地图关键字搜索

时间:2014-06-22 16:38:48      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:android   高德地图   关键字搜索   

EditText startTextView=(EditText) findViewById(R.id.car_search_et);
startTextView.addTextChangedListener(new TextWatcher() {
			
			@Override
			public void onTextChanged(CharSequence s, int start, int count,
	                int after) {
				String newText = s.toString().trim();
				Inputtips inputTips = new Inputtips(SearchCity.this,
						new InputtipsListener() {

							@Override
							public void onGetInputtips(List<Tip> tipList, int rCode) {
								
								if (rCode == 0) {// 正确返回
									
									citylist = new ArrayList<Map<String, String>>();
									
									for (int i = 0; i < tipList.size(); i++) {
										Map<String, String> map=new HashMap<String, String>();
										//city.setName(tipList.get(i).getName()+tipList.get(i).getDistrict());
										map.put("adress", tipList.get(i).getName());
										map.put("city", tipList.get(i).getDistrict());
										citylist.add(map);
									
									}
							
									CityD aAdapter=new CityD(getApplicationContext(), citylist);
									listView.setAdapter(aAdapter);
									aAdapter.notifyDataSetChanged();
								}
							}
						});
			
					try {
						inputTips.requestInputtips(newText, startTextView.getText().toString());
					} catch (com.amap.api.services.core.AMapException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}

				
			}
			
			@Override
			public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
					int arg3) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void afterTextChanged(Editable arg0) {
				// TODO Auto-generated method stub
				
			}
		});

高德地图关键字搜索,布布扣,bubuko.com

高德地图关键字搜索

标签:android   高德地图   关键字搜索   

原文地址:http://blog.csdn.net/mingyue_1128/article/details/32130995

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!