1
可能重複:
Android dynamic String Resources是否可以在Android中使用Strings加載資源?
我有以下幾點:
TextView text = (TextView)vi.findViewById(R.id.text);
TextView txtSub = (TextView)vi.findViewById(R.id.txtSub);
TextView txtA = (TextView)vi.findViewById(R.id.txtA);
TextView txtB = (TextView)vi.findViewById(R.id.txtB);
是否有可能訪問這些使用字符串而不是(這只是僞代碼)?
String resourceName = "text";
TextView text = (TextView)vi.findViewById(R.id. + resourceName);