根据传入的字符串跳转Activity
Intent intent = new Intent(context,Class.forName("com.packname.Activity")); startActivity(intent);
根据传入的字符加载资源
int icon = getResources().getIdentifier(“imageid”, "drawable", getPackageName());
getIdentifier的函数签名如下:
public int getIdentifier (String name, String defType, String defPackage)
时间: 2024-10-05 02:46:20