1.adb shell pm list package查看安装app列表
2.在frameworks的value的string.xml添加属性后,编译时总是报错无法解析
问题代码imageView imageView = (ImageView) findViewById(R.id.img);
imageView.setImageDrawable(getDrawable(com.android.internal.R.drawable.ic_text_dot));
//com.android.internal.R cannot be resolved to a variable
出现问题的原因
You cannot access id‘s of com.android.internal.R at compile time, but you can access the defined internal resources at runtime and get the resource by name.
解决的办法是:
ImageView imageView = (ImageView) findViewById(R.id.img);
imageView.setImageResource(Resources.getSystem().getIdentifier("ic_text_dot", "drawable", "android"));