mardi 11 août 2015

Android programmatically add string id

I need to add programmatically id to new chekboxes.

I try : checkBox.setId("black_eyes");

But i recive the int error.

Then i try : checkBox.setId(Integer.parseInt("black_eyes"));

Here i recive the string to int error

I have to populate a LinearLayout with checkboxes that i recive them from a api ws and i need to show the programmatically. I need to set string id on them

If i can not do this : How can i add new strings to resources file (string.xml) ?




Aucun commentaire:

Enregistrer un commentaire