0
我有下面的代碼,我試圖檢索我捕獲的圖像,而不必將其存儲到外部存儲之前這樣做。有沒有辦法檢索圖像,而不是先將它存儲在任何位置?如何獲取而不存儲它 - Android
private static final int CAMERA_REQUEST = 1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imageView1);
Button captureBtn = (Button) findViewById(R.id.button1);
captureBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {
// get image
}
}