Why is my BroadcastReceiver receiving ACTION_USER_PRESENT twice?
问题 My application needs to make a toast when the user unlocks the screen, so I registered a BroadcastReceiver to pick up the intent ACTION_USER_PRESENT in the manifest, like so: <receiver android:name=".ScreenReceiver" > <intent-filter> <action android:name="android.intent.action.USER_PRESENT"/> </intent-filter> </receiver> And then I defined a class like this: package com.patmahoneyjr.toastr; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent