通过加载静态的xml,可以弹出通知..
如果现在我的xml是动态生成的呢,该怎么做..
public class Notice {
private static final int notification_ID = 0x6238;
private static final int layout_id = 0x23529568;
private static final int img_id = 0x23520068;

private Notification noticed;
private NotificationManager noticedManager;
private PendingIntent pi;
private Context context;
private String pkgName = "";
private RemoteViews rv = null;
private LinearLayout ll = null;
private ImageView img = null; public Notice(Context _context, String pkgname) {
this.context = _context;
pkgName = pkgname;
noticed = new Notification();
Intent intent = new Intent(context, ShowActivity.class);

pi = PendingIntent.getActivity(context, 0, intent, 0);
noticedManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
makeLayout();
rv = new RemoteViews(pkgName, layout_id);
} public void updateNotification(String tipsText, int contentImageID){
noticed.icon = R.drawable.def_icon;
noticed.tickerText = tipsText;
noticed.when = System.currentTimeMillis();
rv.setImageViewResource(img_id, contentImageID);
noticed.contentView = rv;
noticed.contentIntent = pi;
noticedManager.notify(notification_ID, noticed);
}

public void cancelNotification(){
noticedManager.cancel(notification_ID);
}

private void makeLayout(){
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
ll = new LinearLayout(context);
ll.setLayoutParams(lp);
ll.setId(layout_id);
img = new ImageView(context);
img.setLayoutParams(lp);
img.setScaleType(ScaleType.FIT_XY);
img.setId(img_id);

ll.addView(img);
}

}
但是执行后,报错:
android.content.res.Resources$NotFoundException: Resource ID #0x23529568我知道是layout在系统里找不到...
如果要用动态生成的xml的话,改怎么弄????