MapView mapView = (MapView) this.findViewById(R.id.mapView);
LayerView layerView = new LayerView(this);
layerView.setURL("http://MyServerIP:8090/iserver/services/map-china400/rest/maps/China");
//添加图层
mapView.addLayer(layerView);
报错信息
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.bygtgis, PID: 5467
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bygtgis/com.example.bygtgis.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.supermap.imobilelite.maps.MapView.addLayer(com.supermap.imobilelite.maps.AbstractTileLayerView)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
lite 能加载在线地图且实现定位吗?