我在xml文件里定义了多个button的id但在java中把所有button的id放入一个string的数组里用findviewbyid()参数只能是int怎么办?... 我在xml文件里定义了多个button的id
但在java中 把所有button的id放入一个string的数组里
用findviewbyid()参数只能是int 怎么办?

在java中   把所有button的id放入一个int的数组里啊

int[] buttonIDs= { R.id.button1, R.id.button2,
            R.id.button3, R.id.button4, R.id.button5};
String[] buttonNames= {button1, button2,
            button3, button4, button5};
 void findButton(){
 for(int i=0;i<buttonIDs.lenth;i++)
     buttonNames[i] = findviewbyid(buttonIDs[i]);
 }