最後の画像をファイルから取り出し、ImageViewに配置したいと考えています。ファイルまたはギャラリーから最後の画像を検索して撮影します。 Android Studio(Java)
ここで私は、ファイルを作成します。これが動作するかどうか
public File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
// Save a file: path for use with ACTION_VIEW intents
mCurrentPhotoPath = "file:" + image.getAbsolutePath();
return image;
}`
を私はマイファイル/画像から最後の画像をインポートしたいと私はImageViewの上で入れたいです。 –