0
在我的项目中,我试图在onReceive方法中实现相机动作。点击相机图标可以打印日志。我在广播接收器中试过。但我无法得到结果。我在这里附上了我的一段代码。如何打印相机动作日志
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_CAMERA_BUTTON)) {
Log.e("cam0","cam");
//Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
//context.startService(cameraIntent);
// startActivity(cameraIntent, CAMERA_PIC_REQUEST);
}
}
是否可以打印日志。我仍然无法找到结果。在这种情况下寻求帮助。先谢谢你。