方法1:
- Class<?> clazz = Class.forName("com.android.internal.R$id");
- Field field = clazz.getField("icon");
- field.setAccessible(true);
- id_icon = field.getInt(null);
- n.contentView.setImageViewBitmap(InternalID.id_icon, icon);
参考:http://blog.csdn.net/z1074971432/article/details/10446715
方法2:
关于Notification 图标动态替换问题 ,当然如果使用自定义的方式可以直接替换,如果使用系统的方式怎样替换了,废话不多代码如下
View localView = LayoutInflater.from(this.getApplicationContext()).inflate(taskNotify.contentView.getLayoutId(), null);
//查找ImageView
protected static ImageView GetImaeView(View paramView)