我需要获取一些 ImageButton 的背景资源,以便稍后重新使用它,以设置我使用 setBackgroundResource 的背景。我没有找到任何方法来获取背景资源。
private void AddImage(int img){
ImageButton imgact1 = (ImageButton)findViewById(R.id.imgact1);
ImageButton imgact2 = (ImageButton)findViewById(R.id.imgact2);
ImageButton imgact3 = (ImageButton)findViewById(R.id.imgact3);
imgact3.setBackgroundResource(img);
}
谢谢你的帮助 。