0
我实现了来自Google通知示例的代码示例。它工作正常,直到Android 4.2.2,但不是从4.3(在我的Nexus 7 2013年)...我是唯一一个得到这个问题吗?我错过了一个新的通知方法吗?这里是我的简单代码:通知不适用于android 4.3?
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());
谢谢!