0
    Intent intent = new Intent(getApplicationContext(),LocationReceiver.class);
    pendingIntent= PendingIntent.getBroadcast(getApplicationContext(),0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
    lmgr.addProximityAlert(lati,longi,radius,-1, pendingIntent);

<receiver android:name=".LocationReceiver"></receiver>

我想在 android 中监听位置,但未决的意图不起作用。我已经尝试了上面的代码并使用了 getService() 。但没有运气。请引导我正确的方向。

4

1 回答 1

0

您是否声明了此接收器的意图过滤器?确保这一点。并且还在清单中添加与位置相关的权限。

于 2013-05-12T18:19:14.277 回答