我需要获取某些ImageButton的后台资源,稍后重新使用它,以设置我使用setBackgroundResource的背景。我没有找到任何方法来获得背景源。Android获取ImageButton的背景资源
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);
}
感谢您的帮助。
http://developer.android.com/reference/android/widget/ImageButton.html – Raghunandan 2013-04-21 14:10:34