Opening a File from assets folder in android

前端 未结 6 1018
面向向阳花
面向向阳花 2020-12-01 14:37

I have a .gif file inside the assets folder like this assets/Files/android.gif. when I try to open the file it throws an exception at the second line

AssetM         


        
6条回答
  •  误落风尘
    2020-12-01 15:14

    Don't know if things have changed or not but I had an app in Android 1.1 that opened icons to then display them in a view and I did it like so:

    BufferedInputStream buf = new BufferedInputStream(mContext.openFileInput(value));
    Bitmap bitmap = BitmapFactory.decodeStream(buf);
    

提交回复
热议问题