From bc45c62ebdac920dfaf173f5c0f4577c0c1a21f8 Mon Sep 17 00:00:00 2001 From: Ngoc Luong Date: Tue, 16 Jun 2020 16:43:13 +0700 Subject: [PATCH] [Android] Response current battery status after subscribe event --- src/android/BatteryListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/BatteryListener.java b/src/android/BatteryListener.java index d737b71..979fbcf 100755 --- a/src/android/BatteryListener.java +++ b/src/android/BatteryListener.java @@ -71,7 +71,8 @@ public void onReceive(Context context, Intent intent) { updateBatteryInfo(intent); } }; - webView.getContext().registerReceiver(this.receiver, intentFilter); + Intent batteryStatus = webView.getContext().registerReceiver(this.receiver, intentFilter); + updateBatteryInfo(batteryStatus); } // Don't return any result now, since status results will be sent when events come in from broadcast receiver