var context = plus.android.importClass("android.content.Context");
var LocationManager = plus.android.importClass("android.location.LocationManager");
var main=plus.android.runtimeMainActivity();
var mainSvr=main.getSystemService(context.LOCATION_SERVICE);
var GpsStatus = plus.android.importClass('android.location.GpsStatus');
var statusListener = plus.android.implements("io.dcloud.android.location.GpsStatus$Listener", {
onGpsStatusChanged: function(event) {
console.log(event);
}
});
mainSvr.addGpsStatusListener(statusListener);
出现Uncaught Attempt to read from field 'java.lang.Class io.dcloud.invocation.c.b' on a null object reference;at android.location.LocationManager.addGpsStatusListener at new_file.html:1
该怎么解决呀? 急急急!!!!
1 个回复
哎哟yo我去 - 老是有些莫名其妙的问题
能行吗?还是用原生的吧