I am trying to develop a widget which showing Battery Temperature. when i am registering a broadcast Receiver with android.intent.action.BATTERY_CHANGED
it shows some error like this.
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.BATTERY_CHANGED from pid=-1, uid=10058
As far as i know there is no need of permission for broadcast . If it is in the case of an activity. it is working properly.
Intent intent = new Intent();
intent.setAction("android.intent.action.BATTERY");
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);