checkPermission();
//初始化环境
Environment.setLicensePath("/sdcard/SuperMap/license/");
Environment.setTemporaryPath("/sdcard/SuperMap/temp/");
Environment.setWebCacheDirectory("/sdcard/SuperMap/WebCatch");
Environment.initialization(this);
setContentView(R.layout.activity_main);
//打开工作空间
Workspace workspace = new Workspace();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo();
info.setServer("/sdcard/SuperMap/GeometryInfo/World.smwu");
info.setType(WorkspaceType.SMWU);
workspace.open(info);
//将地图显示控件和工作空间关联
MapView mapView = findViewById(R.id.mapview);
MapControl mapcontrol = mapView.getMapControl();
mapcontrol.getMap().setWorkspace(workspace);
//打开工作空间中的第1幅地图
String mapName = workspace.getMaps().get(0);
mapcontrol.getMap().open(mapName);
mapcontrol.getMap().refresh();
这是我的
MainActivity;
workspace.open(info);这行代码报错
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sczh.myfirstsupermap/com.sczh.myfirstsupermap.MainActivity}: java.lang.IllegalStateException: LicenseStatus[
Status = 许可不存在
Type = 正式许可
Version = 0
SartDate = 2020-11-20
ExpireDate = 2020-11-20
]
下面是我的许可文件
Trial License
Modules=851967
Version=900
StartDate=20201120
ExpiredDate=20210220
DeviceIDType=UUID
###
395B0C37A447C26CFDC03AE0994AFFA2
希望朋友们能解答一下