Skip to content
Snippets Groups Projects
Commit 10a2d076 authored by Lennart Goedhart's avatar Lennart Goedhart
Browse files

Use a static string provided by the OS for getting battery level.

parent 9e50e85d
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener; ...@@ -13,6 +13,7 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.graphics.Color; import android.graphics.Color;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.os.BatteryManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
...@@ -449,7 +450,7 @@ public class Medtronic640gActivity extends Activity implements OnSharedPreferenc ...@@ -449,7 +450,7 @@ public class Medtronic640gActivity extends Activity implements OnSharedPreferenc
|| arg1.getAction().equalsIgnoreCase(Intent.ACTION_BATTERY_CHANGED) || arg1.getAction().equalsIgnoreCase(Intent.ACTION_BATTERY_CHANGED)
|| arg1.getAction().equalsIgnoreCase(Intent.ACTION_BATTERY_OKAY)) { || arg1.getAction().equalsIgnoreCase(Intent.ACTION_BATTERY_OKAY)) {
Log.i("BatteryReceived", "BatteryReceived"); Log.i("BatteryReceived", "BatteryReceived");
batLevel = arg1.getIntExtra("level", 0); batLevel = arg1.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment