안녕하세요 푸시 질문입니다.

03-03 18:08:30.949: E/GCMIntentService(14548): Number format exception - Error parsing Notification ID: Invalid int: "null"

Push 기능에서 계속 NOTIFICATION_ID 값에서 에러가 발생을 합니다.
그리고 Push기능이 제대로 동작이 안되는데 구글링에도 별 도움이 안되내요

혹이 이런경우 경험해보신적 있나요 


소스는 아래 입니다.

public static  int NOTIFICATION_ID = 1;

private void sendNotification(Bundle bundle) {

      NOTIFICATION_ID++;

      NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);

      Intent notificationIntent = new Intent(this, MessageActivity.class);

      notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);


     int defaults = Notification.DEFAULT_ALL;

     final String def = bundle.getString("defaults") ;

     if (def != null) {

            try {

                defaults = Integer.parseInt(def);

            } catch (NumberFormatException e) {}

     }

     Log.d(TAG," NOTIFICATION_ID ====["+NOTIFICATION_ID+"]");

     Log.d(TAG," DEFAULT VALUE ====["+defaults+"]");


     notificationIntent.putExtra(Config.CONTENTS_KEY, bundle.getString(Config.CONTENTS_KEY));  

      PendingIntent contentIntent = PendingIntent.getActivity(this, NOTIFICATION_ID, notificationIntent,        PendingIntent.FLAG_UPDATE_CURRENT);

     NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.icon)

       .setStyle(new NotificationCompat.BigTextStyle().bigText(msg))

       .setWhen(System.currentTimeMillis())

       .setContentTitle(title)

       .setTicker(title)

       .setDefaults(defaults)

       .setAutoCancel(true).setContentText(msg);

       mBuilder.setContentIntent(contentIntent);


mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());


}