Android ImageButton - determine what resource is currently set

前端 未结 4 2081
Happy的楠姐
Happy的楠姐 2020-12-19 02:07

Is there a way I can find what resource a particular ImageButton is set to, at any given time?

For eg: I have an ImageButton that I set to R.drawable.btn_on

4条回答
  •  甜味超标
    2020-12-19 02:36

    Just use setTag() and getTag() to associate and retrieve custom data for your ImageView.

提交回复
热议问题