Hem*_*mal 5 android-imageview android-fragments
我有一个片段来编辑内容。在这个片段中,我有 ImageView,它显示从画廊或相机中选取的图像 这个片段反过来也打开了另一个片段。当我回到编辑片段时,从这个片段中显示的图像消失,ImageViews 变为空白,其他所有内容(Edittext、Textviews)保持不变(填充)
请注意,当我返回编辑片段时,它的 OnCreateView 被调用而不是 OnCreate 方法,例如,当我们用另一个片段替换片段并弹出回到前一个片段时,首先调用它的 OnCreateView 方法
我不明白发生了什么请帮助。
老了,但这也许可以帮助其他人。
我通过将源路径设置为变量来解决这个问题,然后调用 onResume() 方法。
@Override
public void onResume() {
super.onResume();
//set again your ImageView source here..
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
532 次 |
| 最近记录: |