Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/386.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.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
Java 电池接收器完全充电不工作_Java_Android_Battery - Fatal编程技术网

Java 电池接收器完全充电不工作

Java 电池接收器完全充电不工作,java,android,battery,Java,Android,Battery,我发现在清单中无法注册意图过滤器电池电量低,电池更换。 我需要在电池充满电时收到通知。当我有一个正在运行的应用程序使其工作时,但当我关闭应用程序使其不工作时。 当应用程序关闭时,我需要接收器在后台运行 Main.class IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); mContext.registerReceiver(this.batteryInfoReceiver,filter); priva

我发现在清单中无法注册意图过滤器电池电量低,电池更换。 我需要在电池充满电时收到通知。当我有一个正在运行的应用程序使其工作时,但当我关闭应用程序使其不工作时。 当应用程序关闭时,我需要接收器在后台运行

Main.class

IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
mContext.registerReceiver(this.batteryInfoReceiver,filter);

private BroadcastReceiver batteryInfoReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) 
        {
        ...
        }

您是用哪种编程语言实现代码的?java语言Android