Answers for "reflection with R.id"

0

reflection with R.id

Class c = Class.forName("com.startpage.mobile.R$string");
Field field = c.getDeclaredField("text_" + num);
int resId = (int)field.get(null);
String text = this.getResources().getString(resId);
textView.setText(text);
Posted by: Guest on January-23-2022

Code answers related to "reflection with R.id"

Browse Popular Code Answers by Language