Android ImageView setImageResource in code

后端 未结 5 464
太阳男子
太阳男子 2020-12-13 05:01

I have an imageView that I want to display a little icon of the country that you are currently in. I can get the country code, but problem is I can\'t dynamically change the

5条回答
  •  有刺的猬
    2020-12-13 05:56

    you may try this:-

    myImgView.setImageDrawable(getResources().getDrawable(R.drawable.image_name));
    

提交回复
热议问题