开发者

Java android put a variable to find a spinner id

I have a xml layout where is my spinner with id "test"

How can I put my variable "IdSpinner" into R object.

I want to make a common method to create a lot of spinners ,where arg开发者_开发问答ument is a spinner id.

listLanguage('test');

public void listLanguage(String test) {
   final Spinner spinnerLanguage = (Spinner) findViewById(R.id....);
}


You can't do it in this way (if I understood correctly)- I mean put idSpinner in R.id..., use another approach - just create dynamically Spinner object, in this case you can create as much Spinners as you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜