无论如何在睡眠模式下检测相机按钮?我尝试了这个论坛中解释的示例,但在睡眠模式下没有任何作用..我正在寻找这个很长时间,但没有正确的答案..
请帮我...
public class YourBoardcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_CAMERA_BUTTON.equals(intent.getAction())) {
Intent main = new Intent();//
}
}
}
And in your Manifest :
<receiver android:name="YourBoardcastReceiver">
<intent-filter>
<action android:name="android.intent.action.SCREEN_ON" />
</intent-filter>
</receiver>