I am trying to post a notification with a custom view in the notification area from an IntentService, and getting the Couldn't expand RemoteView error.
Here's what I am doing in onCreate():
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
icon = R.drawable.icon;
tickerText = "data upload in progress";
contentView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.notiflayout);
contentView.setImageViewResource(R.id.image, R.drawable.icon);
contentView.setTextViewText(R.id.text, "Hello");
contentView.setProgressBar(R.id.progressBar, 100, 10, false);
whatNext = PendingIntent.getActivity(getApplicationContext(), 0, new Intent(getApplicationContext(), starterActivity.class), 0);
notification = new Notification(icon, tickerText, System.currentTimeMillis());
notification.contentView = contentView;
notification.contentIntent = whatNext;
I am calling notify() from onHandleIntent(), and canceling the notifications in onDestroy().
I have verified that this code works in an independent app, which does not have an IntentService. Doing this in an IntentService is somehow giving trouble.
Could someone please explain what is it that I am doing wrong?

