我需要獲取某些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