0

私は通知を作成し、一定時間後にそれを受信しようとしています。「E/JavaBinder:!!!」を取得するFAILED BINDER TRANSACTION !!! (パーセルサイズ= 9448080) '通知を作成しようとしています

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)があるgetNotification()方法である

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); 

    } 
} 

ここにあります:

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です:ここで

の方法です印刷される。

ここを何が起こっていると私はそれをどのように修正することができますか?

お知らせください。

+0

これは、あなたが '' putExtra(「テキスト」、テキスト)へのすべてのそれらの呼び出しで(使用している実際のコードですか?それとも、これは単なる一例です。あなたの通知が大きい9メガバイトであるようにそれはあまりにも大きい、見えます。 –

+0

@DavidWasserええ、これは実際のコードですが、私は実際のキーと値を 'text'に置き換えました。私は' Intent'のテキストをエクストラとして入れています。 –

答えて

0

私はここでの問題を考え出し、それは、通知の小さなアイコンでいました。バインダーの上限を超えました。

同じアイコンが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); 

をし、今はより多くのエラーはありません。

関連する問題