更新时间:2023-11-25 18:27:52
试试这个:
ImageView imageView = (ImageView) findViewById(R.id.image);
File filePath = getFileStreamPath(fileName);
imageView.setImageDrawable(Drawable.createFromPath(filePath.toString()));
在上面的代码 R.id.image
是的ImageView
地方在你的布局ID。 文件名
是在 openFileOutput $ C $使用的文件的
字符串
包含名称C>调用。
In the above snippet R.id.image
is id of ImageView
somewhere in your layout. fileName
is a String
containing name of the file you used in openFileOutput
call.