Here is the notification implementation code:
Notification notification = new Notification(); RemoteViews expandedView = new RemoteViews(mContext.getPackageName(), R.layout.status_bar_ongoing_event_progress_bar); // ignore the setup code for expanedView notification.contentView = expandedView; Intent intent = new Intent(mContext, MyActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); notification.contentIntent = contentIntent; mNotificationMgr.notify(notification_id, notification);
This code works fine on Android 2.2 device, however it does not work on Android 4.0 device. When the user clicks the notification, MyActivity does not start and nothing happens.
I do not know the reason.
source share