Notifications 通知不';你不能在安卓4.3上工作吗?
我实现了来自Google通知示例的代码示例。它在安卓4.2.2之前运行良好,但在4.3之后就没有了(在我的Nexus7 2013上)。。。我是唯一一个遇到这个问题的人吗?我是否错过了新的通知方法?以下是我的简单代码:Notifications 通知不';你不能在安卓4.3上工作吗?,notifications,android-4.3-jelly-bean,Notifications,Android 4.3 Jelly Bean,我实现了来自Google通知示例的代码示例。它在安卓4.2.2之前运行良好,但在4.3之后就没有了(在我的Nexus7 2013上)。。。我是唯一一个遇到这个问题的人吗?我是否错过了新的通知方法?以下是我的简单代码: final int NOTIFICATION_ID = 1; NotificationManager mNotificationManager; mNotificationManager = (NotificationManager) th
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());
谢谢 事实上,问题来自于我的php文件的错误编码,无论出于何种原因,它都会跳过向数据库添加新用户(注册id)的请求。GCM服务器无法了解我的设备,因为它未添加到数据库 关键是它可以在安卓4.3中运行