问题
working an an app with GCM support, no problems there. But when I push the notification, the app crashes an LogCat says the following:
03-21 14:32:13.276: E/AndroidRuntime(4457): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.yanniks.cm_updatechecker/de.yanniks.cm_updatechecker.UpdateChecker}: java.lang.IllegalArgumentException: Must specify a valid wake lock level.
How do I define the valid wake lock level?
Please help!
回答1:
You must specify one of
- PARTIAL_WAKE_LOCK
- FULL_WAKE_LOCK
- SCREEN_DIM_WAKE_LOCK
- SCREEN_BRIGHT_WAKE_LOCK
when you call newWakeLock
回答2:
There also two extra flags:
- ACQUIRE_CAUSES_WAKEUP
- ON_AFTER_RELEASE
You can use "|" with PARTIAL_WAKE_LOCK, FULL_WAKE_LOCK, SCREEN_DIM_WAKE_LOCK, SCREEN_BRIGHT_WAKE_LOCK.
来源:https://stackoverflow.com/questions/15555630/specify-valid-wake-lock-level