У меня есть следующие журналы, при этом нажимая на уведомление. Когда я нажимаю на уведомление, оно не принесло приложение на передний план или открыть приложение. Это происходит только в Kitkat, на протяжении других работ.09-20 12:14:43.390 3076-3076/com.testapp E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
09-20 12:14:43.390 3076-3076/com.testapp E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
09-20 12:14:43.410 3076-3263/com.testapp E/MyGcmListenerService: Bundle[{google.sent_time=1505889885380, gcm_order=3, title=Test 1, google.message_id=0:1505889885603858%e6c595e0f9fd7e12, message=Test 1}]
09-20 12:14:43.430 3076-3263/com.testapp D/dalvikvm: DexOpt: couldn't find field Landroid/app/Notification;.headsUpContentView
09-20 12:14:43.430 3076-3263/com.testapp W/dalvikvm: VFY: unable to resolve instance field 20
09-20 12:14:43.430 3076-3263/com.testapp D/dalvikvm: VFY: replacing opcode 0x5b at 0x005d
09-20 12:14:43.430 3076-3263/com.testapp D/dalvikvm: DexOpt: couldn't find field Landroid/app/Notification;.headsUpContentView
09-20 12:14:43.440 3076-3263/com.testapp W/dalvikvm: VFY: unable to resolve instance field 20
09-20 12:14:43.440 3076-3263/com.testapp D/dalvikvm: VFY: replacing opcode 0x5b at 0x004c
09-20 12:14:43.450 3076-3263/com.testapp D/dalvikvm: DexOpt: couldn't find field Landroid/app/Notification;.headsUpContentView
09-20 12:14:43.450 3076-3263/com.testapp I/dalvikvm: DexOpt: unable to optimize instance field ref 0x0014 at 0x54 in Landroid/support/v7/app/NotificationCompat;.addHeadsUpToBuilderLollipop
09-20 12:14:43.450 3076-3263/com.testapp D/dalvikvm: DexOpt: couldn't find field Landroid/app/Notification;.headsUpContentView
09-20 12:14:43.450 3076-3263/com.testapp I/dalvikvm: DexOpt: unable to optimize instance field ref 0x0014 at 0x61 in Landroid/support/v7/app/NotificationCompat;.addHeadsUpToBuilderLollipop
09-20 12:14:43.460 3076-3263/com.testapp D/NotificationManager: com.testapp: notify(1000, Notification(pri=0 contentView=com.testapp/0x10900cf vibrate=default sound=default defaults=0x3 flags=0x10 kind=[null]))
< /code>
Вот мой код: < /p>
android.support.v4.app.NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(getNotificationIcon())
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.setContentTitle(title)
.setContentText(message)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
.setAutoCancel(true);
Intent notificationIntent = new Intent(this, activityName);
notificationIntent.putExtras(data);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(contentIntent);
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(BROADCAST_NOTIFICATION_ID++, mBuilder.build());`
Подробнее здесь: https://stackoverflow.com/questions/463 ... foreground
Android Kitkat выпуск: приложение не вышло на передний план ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Создание Jetpack – как обновить экран, когда приложение возвращается на передний план
Anonymous » » в форуме Android - 0 Ответы
- 31 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Создание нового экземпляра таймера, когда приложение выходит на передний план?
Anonymous » » в форуме IOS - 0 Ответы
- 17 Просмотры
-
Последнее сообщение Anonymous
-