AnilPatel AnilPatel - 3 months ago 18
Android Question

how to Notifications need WAKE_LOCK in android?

how to remove this error during download image and when Updating Notification.


java.lang.SecurityException: Neither user 10080 nor current process
has android.permission.WAKE_LOCK. at
android.os.Parcel.readException(Parcel.java:1425) at
android.os.Parcel.readException(Parcel.java:1379) at
android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:326)
at
android.os.PowerManager$WakeLock.acquireLocked(PowerManager.java:309)
at android.os.PowerManager$WakeLock.acquire(PowerManager.java:300) at
android.app.NotificationManager.notify(NotificationManager.java:128)
at
android.app.NotificationManager.notify(NotificationManager.java:104)

Answer

for Wakelock permission in your android manifest file use

<uses-permission android:name="android.permission.WAKE_LOCK" />
Comments