lunes, 10 de febrero de 2014

Android: Resource from string

View view = (View) findViewById(getResources().getIdentifier(<dynamically_generated_view_id>, "id", activity.getPackageName()));


Note:

Instead of "id" you could use, for instance, "drawable" and obtain a resource ID for a drawable given a string.

No hay comentarios:

Publicar un comentario