Android ImageView setImageResource in code

后端 未结 5 484
太阳男子
太阳男子 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:37

    you use that code

    ImageView[] ivCard = new ImageView[1];
    
    @override    
    protected void onCreate(Bundle savedInstanceState)  
    
    ivCard[0]=(ImageView)findViewById(R.id.imageView1);
    

提交回复
热议问题