android addProximityAlert函数如何判断 离开状态,目前我需要判断接近和离开区域2种状态,如何来做呀?多谢!

解决方案 »

  1.   

    Sets a proximity alert for the location given by the position (latitude, longitude) and the given radius. When the device detects that it has entered or exited the area surrounding the location, the given PendingIntent will be used to create an Intent to be fired. 
    这个是文档中关于这个函数说明的部分。
    你看看就明白了,上面说得很明白,当接近或离开的是后,会引起你已经定义好的PendingIntent的变化,你可以根据这来实现你要的功能。
      

  2.   

    with an extra keyed as LocationManager.KEY_PROXIMITY_ENTERING set to
    true or false accordingly.
      

  3.   

    String key=LocationManager.KEY_PROXIMITY_ENTERINF;
    Boolean isEnter = intent.getBooleanExtra(key,false);
    if(isEnter){
      ....}
      

  4.   

    我写的还运行不起来,楼主解决了没,能否发过来参考一下
    [email protected]
    也可以加QQ一起探讨
    qq 1505889391