我正在创建这样的通知:
Intent intent = new Intent(this, OfferNotification.class);
PendingIntent pIntent = PendingIntent.getActivity(this, 0,
intent, 0);
Uri soundUri = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this).setSmallIcon(R.drawable.unknown)
//.setLargeIcon(BitmapFactory.decodeResource( getResources(), R.drawable.unknown))
.addAction(R.drawable.ic_launcher, "d", pIntent)
.setAutoCancel(true)
.setContentTitle("Offer from " + restaurantName)
.setContentText(offerDescriptoin).setSound(soundUri);
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(this, OfferNotification.class);
resultIntent.putExtra("offerID", offer.getID());
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(OfferNotification.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(offer.getID(), mBuilder.build());
当我使用小图标时,它工作得很好,但是当我使用大图标时,我可以发出通知的声音,但通知本身没有出现,有什么帮助吗?