【发布时间】:2015-05-07 07:45:32
【问题描述】:
我正在尝试获取图片,但使用我的代码,需要通过“点击”手势确认图片。
这是我的代码:
private void takePicture() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, TAKE_PICTURE_REQUEST);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == TAKE_PICTURE_REQUEST && resultCode == RESULT_OK) {
String thumbnailPath = data.getStringExtra(Intents.EXTRA_THUMBNAIL_FILE_PATH);
String picturePath = data.getStringExtra(Intents.EXTRA_PICTURE_FILE_PATH);
processPictureWhenReady(picturePath);
// TODO: Show the thumbnail to the user while the full picture is being
// processed.
}
else{
takePicture();
}
super.onActivityResult(requestCode, resultCode, data);
}
我看过这个帖子:
Is it possible to take a photo using Google Glass without "tap to accept"?
但是没有 Tap 我无法获取图片。 有例子吗?
谢谢!
【问题讨论】:
标签: android android-camera google-glass