在活动的onCreate方法中,已经获得了图片的路径“”thePhoto“”,想让活动一创建就显示图片,为什么一直显示不出来
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.text_layout);
picture = (ImageView) findViewById(R.id.photo_image);
if(thePhoto != null) {
Uri uri = Uri.parse(thePhoto);
picture.setImageURI(uri);
}
}
https://www.jianshu.com/p/c42b805e81fa
对于Imageview,有一些是因为图片本身问题,解析不了,需要美工处理一下,有些是因为图太大,无法加载,但也不报错,所以需要压缩