Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 阻止自动调用MonitorNotifier回调的didextRegion()方法_Android_Bluetooth Lowenergy_Altbeacon - Fatal编程技术网

Android 阻止自动调用MonitorNotifier回调的didextRegion()方法

Android 阻止自动调用MonitorNotifier回调的didextRegion()方法,android,bluetooth-lowenergy,altbeacon,Android,Bluetooth Lowenergy,Altbeacon,当应用程序转到后台时,会自动调用MonitorNotifier回调函数的didExitRegion() 如何防止自动呼叫 @Override public void **onBeaconServiceConnect**() { System.out.println("call onBeaconServiceConnect()"); try { System.out.println("call notifier ");

当应用程序转到后台时,会自动调用MonitorNotifier回调函数的didExitRegion()

如何防止自动呼叫

@Override
    public void **onBeaconServiceConnect**() {
        System.out.println("call onBeaconServiceConnect()");
        try {
            System.out.println("call notifier ");


            mBeaconManager.setRangeNotifier(this);
            mBeaconManager.startMonitoringBeaconsInRegion(mAllBeaconsRegion);


            mBeaconManager.setMonitorNotifier(new MonitorNotifier() {
                @Override
                public void didEnterRegion(Region region) {
                    System.out.println("monitor enter " + region.getId1());
                }


                @Override
                public void didExitRegion(Region region) {
                    System.out.println("monitor exit " + region.getId1());
                }


                @Override
                public void didDetermineStateForRegion(int i, Region region) {
                    System.out.println("monitor " + region.getId1());
                }
            });

            mBeaconManager.startRangingBeaconsInRegion(mAllBeaconsRegion);

        } catch (RemoteException e) {
            e.printStackTrace();
            System.out.println("call notifier exception"+e.toString());
        }
    }

如果你想知道答案,请注意拼写和语法。我为你解决了这个问题。这不是预期的行为。您的应用程序编程方式可能存在问题,导致isdue。请编辑您的问题以显示您的代码。请参阅我已编辑了我的问题。谢谢。您正在使用BackgroundPowerSaver吗?是否自定义库中的扫描间隔?将应用程序置于后台多长时间后会收到退出回调?这是BackgroundPowerSaver的代码片段。BackgroundPowerSaver BackgroundPowerSaver=新的BackgroundPowerSaver(此);MBeAcon经理。在扫描周期之间的挫折(1);mBeaconManager.setBackgroundMode(true);MBeAcon经理。挫折期(1);我需要改变什么?