+ private void readImageFile(final String readFileName)
+ {
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ readImageFileImpl(readFileName);
+ }
+ });
+ try
+ {
+ thread.start();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void readImageFileImpl(final String readFileName)
+ {
+ try
+ {
+ byte[] dummyImageData = new byte[1280 * 1024 + 8];
+ final String directoryPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getPath() + "/AirA01a/";
+ File filepath = new File(directoryPath.toLowerCase(), readFileName.toLowerCase());
+ FileInputStream istr = new FileInputStream(filepath);
+
+ final Bitmap imageData = BitmapFactory.decodeStream(istr);
+ istr.close();
+
+ ////// 画像表示を更新する
+ activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ try
+ {
+ // ビットマップイメージを表示する。
+ ImageView view = activity.findViewById(R.id.imageView);
+ view.setImageBitmap(imageData);
+ view.invalidate();
+ }
+ catch (Throwable e)
+ {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }