Android--显示指定路径的图片


String localIconNormal = "/data/data/com.android.factorypattern/FPTest.bmp";
    File localFile;
    FileInputStream localStream = null;
    Bitmap bitmap = null;
    localFile = new File(localIconNormal);
    if (!localFile.exists()) {
          Log.d(TAG, localIconNormal + " is null.");
    } else {
         try {
              localStream = new FileInputStream(localFile);
              bitmap = BitmapFactory.decodeStream(localStream);
              fingerprint_image.setImageBitmap(bitmap);
              if (localStream != null) {
                  localStream.close();}
         } catch (Exception e) {
               e.printStackTrace();
         }



你可能感兴趣的:(Android应用,Android基础知识)