Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.Intent; import android.content.IntentFilter; public class Main { private static Intent getBatteryStatus(Context context) { IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); return context.registerReceiver(null, filter); } }