On htc, android 4.2 by pressing push (a), the activity does not open. on other devices works, what could be the problem?

Intent intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtras(extras); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setSmallIcon(R.mipmap.ic_gooto) .setContentInfo(formatTime) .setContentTitle(name) .setContentText(message) .setStyle(new NotificationCompat.BigTextStyle() .bigText(message)) .setDefaults(Notification.DEFAULT_SOUND) .setVibrate(new long[]{500, 500, 500}) .setAutoCancel(true) .setContentIntent(contentIntent) .setPriority(2) .setTicker(message); mNotificationManager.notify(NOTIFICATION_ID, builder.build()); 

    1 answer 1

    According to en-SO, you can try these options:

    1. Use the PendingIntent.FLAG_CANCEL_CURRENT flag instead of PendingIntent.FLAG_UPDATE_CURRENT

    2. In the manifest, add the android:exported="true" attribute to the activation tag android:exported="true"

    3. Add another flag PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT