尝试构建通知时收到 'E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 9448080)'

Getting 'E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 9448080)' while trying to build a notification

我正在尝试构建一个通知并在一段时间后接收它。

方法如下:

futureInMillis = SystemClock.elapsedRealtime() + 176000;

Intent notificationIntent = new Intent(getBaseContext(), NotificationG.class);
notificationIntent.putExtra(NotificationG.NOTIFICATION, getNotification());
PendingIntent pendingIntent = PendingIntent.getBroadcast(getBaseContext(), m, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, futureInMillis, pendingIntent);

这里是NotificationG.class

public class NotificationG extends BroadcastReceiver {

    public static String NOTIFICATION = "notification_gatsp";
    public static NotificationManager mNotifyMgr;

    @Override
    public void onReceive(Context context, Intent intent) {

        mNotifyMgr =
                (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);

        Notification notification = intent.getParcelableExtra(NOTIFICATION);
        notification.defaults |= Notification.DEFAULT_SOUND;
        notification.defaults |= Notification.DEFAULT_VIBRATE;
        mNotifyMgr.notify(5, notification);

    }
}

这是getNotification()方法:

public Notification getNotification() {

icon = BitmapFactory.decodeResource(getBaseContext().getResources(),
            R.drawable.app_icon_1);

        mBuilder =
                new NotificationCompat.Builder(getBaseContext())
                        .setSmallIcon(R.mipmap.app_icon_1)
                        .setContentTitle("title")
                        .setLargeIcon(icon)
                        .setStyle(new NotificationCompat.BigTextStyle().bigText(""))
                        .setContentText("");

        Intent resultIntent = new Intent(getBaseContext(), ARequest.class);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);
        resultIntent.putExtra("text", text);

        // Because clicking the notification opens a new ("special") activity, there's
        // no need to create an artificial back stack.
        PendingIntent resultPendingIntent =
                PendingIntent.getActivity(
                        getBaseContext(),
                        0,
                        resultIntent,
                        PendingIntent.FLAG_UPDATE_CURRENT
                );

        mBuilder.setAutoCancel(true);
        mBuilder.setContentIntent(resultPendingIntent);
        return mBuilder.build();
    }

但我没有收到任何通知,而是显示此错误:E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 9448080) 正在打印出来。

这是怎么回事,我该如何解决?

请告诉我。

我在这里找到了问题,它与通知的小图标有关。它超出了活页夹限制。

同样的图标也保存在我的 mipmap 文件夹中,将引用从 R.drawable.app_icon_1 更改为 R.mipmap.app_icon_1 为我完成了工作。

我更改了这一行:

icon = BitmapFactory.decodeResource(getBaseContext().getResources(),
            R.drawable.app_icon_1);

有了这个:

icon = BitmapFactory.decodeResource(getBaseContext().getResources(),
            R.mipmap.app_icon_1);

现在没有错误了。