0

Google 通知の例からコード サンプルを実装しました。Android 4.2.2 までは正常に動作しますが、4.3 以降 (Nexus 7 2013) では動作しません... この問題が発生するのは私だけですか? 新しい通知方法を見逃しましたか? ここに私の簡単なコードがあります:

    final int NOTIFICATION_ID = 1;
        NotificationManager mNotificationManager;

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

        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, HomeActivity.class), 0);

        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
        .setSmallIcon(R.drawable.icon)
        .setContentTitle("Title")
        .setStyle(new NotificationCompat.BigTextStyle()
        .bigText(""))
        .setContentText("Message");

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

ありがとう !

4

1 に答える 1