我已经购买了一个应用,一切正常,但是位置不起作用,当用户点击“位置”时,会显示带有googlemaps的弹出窗口,并在应用崩溃时关闭。
我能够将设备+应用连接到AndroidStudio,并发现以下问题
to activity {com.test.app/com.test.app.ui.activity.BaseActivity}: java.lang.NullPointerException: intent must not be null
问题在这里:
if (requestCode == 101) {
if (resultCode == RESULT_OK) {
place = PlaceAutocomplete.getPlace(getActivity(), data);
getAddress(place.getLatLng().latitude, place.getLatLng().longitude);
} else if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
HERE IS A PROBLEM ->>> Status status = PlaceAutocomplete.getStatus(getActivity(), data);
// TODO: Handle the error.
Log.e("Tag", status.getStatusMessage());
}
// } else if (resultCode == RESULT_CANCELED) {
// // The user canceled the operation.
// }
}
}
还说BaseActivity出了什么问题
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQUEST_CHECK_SETTINGS_GPS:
switch (resultCode) {
case Activity.RESULT_OK:
getMyLocation();
break;
case Activity.RESULT_CANCELED:
break;
}
break;
}
}
有人可以帮助解决此问题吗?
谢谢!