草庐IT

ReceiverPositioningAlarm

全部标签

android - 在广播接收器/或服务中获取 GPS 位置以广播接收器数据传输

我是安卓新手。我想在广播接收器中获取GPS位置,但它显示错误。我的代码是:publicvoidonReceive(Contextcontext,Intentintent){LocationManagerlocManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);//errorsingetSystemServicemethodLocationListenerlocListener=newMyLocationListener();locManager.requestLocationUpdates(Locati

android - 在广播接收器/或服务中获取 GPS 位置以广播接收器数据传输

我是安卓新手。我想在广播接收器中获取GPS位置,但它显示错误。我的代码是:publicvoidonReceive(Contextcontext,Intentintent){LocationManagerlocManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);//errorsingetSystemServicemethodLocationListenerlocListener=newMyLocationListener();locManager.requestLocationUpdates(Locati