• 软工每日总结6


    今天的工作是将百度地图的建议结果查询集成到我们的软件中:

    主要代码:

    mSuggestionSearch = SuggestionSearch.newInstance();
    mSuggestionSearch.setOnGetSuggestionResultListener(this);
    addTextChangedListener(new TextWatcher() {

    @Override
    public void afterTextChanged(Editable arg0) {
    Log.e("e","after");
    }

    @Override
    public void beforeTextChanged(CharSequence arg0, int arg1,
    int arg2, int arg3) {
    Log.e("e","before");
    }

    @Override
    public void onTextChanged(CharSequence cs, int arg1, int arg2,
    int arg3) {
    Log.e("e","on");
    if (cs.length() <= 0) {
    return;
    }
    String city = "北京";
    /**
    * 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新
    */
    mSuggestionSearch
    .requestSuggestion((new SuggestionSearchOption())
    .keyword(cs.toString()).city(city));
    }
    });

    @Override
    public void onGetSuggestionResult(SuggestionResult res) {
    if (res == null || res.getAllSuggestions() == null) {
    Log.e("e", "invalid");
    return;
    }
    str=new String[10];
    int i=0;
    for (SuggestionResult.SuggestionInfo info : res.getAllSuggestions()) {
    if (info.key != null&&i<10) {
    str[i] = info.key;
    Log.e("e",info.key);
    i++;
    }
    }
    sugAdapterSt = new ArrayAdapter<String>(this,
    android.R.layout.simple_dropdown_item_1line,str);
    editSt.setAdapter(sugAdapterSt);
    sugAdapterEd = new ArrayAdapter<String>(this,
    android.R.layout.simple_dropdown_item_1line,str);
    editEn.setAdapter(sugAdapterEd);
    }
    遇到的问题:android studio导入eclipse的安卓工程时出现开发环境不兼容的情况,一些图片资源无法正常使用,在降低AS使用的gradle版本之后得到暂时解决,还有就是windows下的开发工具大多不使用utf-8编码,导致导入到linux环境后中文乱码。
  • 相关阅读:
    oracle入门
    转-nginx详解
    VNX磁盘状态分析
    Linux下确定哪个网卡对应哪个接口?
    企业运维人员最常用150个linux命令汇总
    linux系统LVM管理-逻辑卷扩容
    VNX1代-VNX2代
    VNX-SPS电池
    VNX存储系统,在磁盘做rebuilding的时候是否可以更换故障硬盘?
    Ubuntu系统挂载大于2T新硬盘方法
  • 原文地址:https://www.cnblogs.com/evi10032/p/5645795.html
Copyright © 2020-2023  润新知