PERMISSION_UNFINISHED
2024-05-11 06:09:19
使用百度地图进行poi查询的时候,会返回PERMISSION_UNFINISHED,具体原因不清楚,但是似乎是一个BUG。
我们在返回的result设置定点,调试一下。返回的a,b,c,d为0,e,f,g为null。
这里的a,b,c,,e,f,g分别表示什么。我们可以打开PoiResult的源码,看它是如何定义的。
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//package com.baidu.mapapi.search.poi;import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.baidu.mapapi.search.core.CityInfo;
import com.baidu.mapapi.search.core.PoiInfo;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.core.SearchResult.ERRORNO;
import com.baidu.mapapi.search.poi.PoiAddrInfo;
import com.baidu.mapapi.search.poi.b;
import java.util.List;public class PoiResult extends SearchResult implements Parcelable {private int a = 0;private int b = 0;private int c = 0;private int d = 0;private List<PoiInfo> e;private List<CityInfo> f;private List<PoiAddrInfo> g;private boolean h = false;public static final Creator<PoiResult> CREATOR = new b();PoiResult() {}PoiResult(ERRORNO var1) {super(var1);}PoiResult(Parcel var1) {this.a = var1.readInt();this.b = var1.readInt();this.c = var1.readInt();this.d = var1.readInt();this.e = var1.readArrayList(PoiInfo.class.getClassLoader());this.f = var1.readArrayList(CityInfo.class.getClassLoader());}public int getCurrentPageNum() {return this.a;}void a(int var1) {this.a = var1;}public int getTotalPageNum() {return this.b;}void b(int var1) {this.b = var1;}public int getCurrentPageCapacity() {return this.c;}void c(int var1) {this.c = var1;}public int getTotalPoiNum() {return this.d;}void d(int var1) {this.d = var1;}public List<PoiInfo> getAllPoi() {return this.e;}void a(List<PoiInfo> var1) {this.e = var1;}public List<PoiAddrInfo> getAllAddr() {return this.g;}void b(List<PoiAddrInfo> var1) {this.g = var1;}public boolean isHasAddrInfo() {return this.h;}void a(boolean var1) {this.h = var1;}public List<CityInfo> getSuggestCityList() {return this.f;}void c(List<CityInfo> var1) {this.f = var1;}public int describeContents() {return 0;}public void writeToParcel(Parcel var1, int var2) {var1.writeInt(this.a);var1.writeInt(this.b);var1.writeInt(this.c);var1.writeInt(this.d);var1.writeList(this.e);var1.writeList(this.f);}
}
在定义中我们可以看到,a表示的是CurrentPageNum,b表示的是TotalPageNum,c表示的是CurrentPageCapacity,d表示的是TotalPoiNum,e表示的是List,f表示的是List,g表示的是List。
再回到那个PERMISSION_UNFINISHED的BUG上来,通过网上查询,发现一个不算办法的办法,就是返回重新打开一次。
我重新打开一次发现
成功
我们来查看一下返回的数据
返回了一个ArrayList,它的size为10,每个item里面包括了一些我们需要的信息:
address(地址),city(城市),location(经纬度),name(名称),phoneNum(联系方式),postCode(邮政编码)。
我调用的是PoiSearch的searchInCity()方法,还有其他的方法searchNearby(),searchInBound(),searchPoiDetail()。
PERMISSION_UNFINISHED相关推荐
- Android开发过程中使用到百度地图时,报错“PERMISSION_UNFINISHED”
项目中开发百度地图时,有使用到反向Geo获取地理位置信息,结果log报错"PERMISSION_UNFINISHED",刚开是以为是jar版本使用不准确,后来仔细检查之后发现是,项 ...
最新文章
- mac下homebrew一些总结
- 内核驱动中常见的miscdevice、platform_device、platform_driver
- openAL在mac下播放音源结束时判断处理
- 即时聊天IM之二 openfire 整合现有系统用户
- 修改无效_修改劳动合同日期被认定无效,青岛一企业被判赔双倍工资
- PHP获取服务器端的相关信息
- linux系统命令:yum和apt-get
- java 编译class_.java文件怎样编译成.class文件,你值得一看的技巧
- python基础知识-Python基础知识
- 干货,下载网易云课堂和B站的视频
- 西门子300硬件升级包下载_「西门子1200PLC教程」19.S7-1200入门实例
- 脑机接口五大应用场景
- 小米5预装android版本,小米5刷机原生OS
- 批量OCR识别图片中的文字
- 修改某张表的结构_在T-SQL语言中,若要修改某张表的结构,应该使用的修改关键字是Alter。...
- 零成本、零流量,我是如何空手反套白狼?
- 逻辑思维案例题(二)
- -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable a
- 高通平台android开发总结 MSM平台上的AMSS
- python 实现四则运算(一)