Подтвердить что ты не робот

Плохая длина массива, менеджер уведомлений вызывает сбой телефона на 4.4

Я запустил приложение в BETA-тестирование, а несколько пользователей с 4.4 Устройства сообщили, что приложение вызывает крушение всего телефона, телефон почти перезагружается после запуска приложения, хотя приложение даже не имеет таких разрешений.

Сообщение, которое я получил от тестеров, выглядит следующим образом:

java.lang.RuntimeException: bad array lengths
at android.os.Parcel.readIntArray(Parcel.java:820)
at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:348)
at android.app.NotificationManager.notify(NotificationManager.java:139)
at android.app.NotificationManager.notify(NotificationManager.java:112)
at als.wakeup.Awake_Alarm$MyLocationListener.onLocationChanged(Awake_Alarm.java:272)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:279)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:208)
at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:224)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

Это отлично работает на 4.2, 4.3, но похоже, что Galaxy Note 3 и Galaxy S5 запускают перезапуск 4.4.

Что может быть причиной? Связано ли это приложение или может быть сбой в новой ОС?

Просто выяснилось, что он отлично работает на Xperia Z1 с 4.4 и без сбоев. Кажется, что только samsung вызывает это, любые советы?

Функция создания уведомлений:

public Notification CreateNotification(double distance){


    Intent notificationIntentStop = new Intent(this.getApplicationContext(), StopService.class);
    PendingIntent contentIntentStop = PendingIntent.getActivity(this.getApplicationContext(), 0, notificationIntentStop, 0);


    Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.logo);
    Shortcuts shorts = new Shortcuts(this);
    NotificationCompat.Builder mBuilder =
            new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.logo)
            .setContentTitle("Localarm Running")
            .setLargeIcon(largeIcon);
    //mBuilder.addAction(R.drawable.ico, "Stop", contentIntentStop);
    if(distance > 0){
    mBuilder.setContentText(String.valueOf(roundTwoDecimals(shorts.ConvertUnits(distance))+" "+shorts.GetUnitNames(distance)+" to Alarm."));
    }
    else{
    mBuilder.setContentText(String.valueOf("You've reached your destination"));
    }
    mBuilder.setPriority(Notification.PRIORITY_MAX);
    Notification bui = mBuilder.build();

    bui.flags|= Notification.FLAG_NO_CLEAR;
        Intent notificationIntent = new Intent(this.getApplicationContext(), Intro.class);
        PendingIntent contentIntent = PendingIntent.getActivity(this.getApplicationContext(), 0, notificationIntent, 0);
        bui.contentIntent = contentIntent;



    return bui;

}

он вызывается: onLocationChanged()

    NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);        
    notificationManager.notify(0, CreateNotification(dist_difference-alert_range));
4b9b3361

Ответ 1

Это проблема в Android. К сожалению, я не думаю, что вы можете что-то с этим сделать.