该库运行良好,但我对此表示怀疑。
当我向多于两行的用户发送消息时,用户在通知区域中看不到所有消息。
但我知道ANDROID可以做到
http://developer.android.com/guide/topics/ui/notifiers/notifications.html#ApplyStyle。如何进行通知parse.com
?
看图片来说明我的问题
Bitmap icon1 = BitmapFactory.decodeResource(getResources(),
R.drawable.gorio);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
getApplicationContext()).setAutoCancel(true)
.setContentTitle("Exemplo 1")
.setSmallIcon(R.drawable.gorio)
.setLargeIcon(icon1).setContentText("Hello World!");
NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
bigText.bigText(msg);
bigText.setBigContentTitle("GORIO Engenharia");
bigText.setSummaryText("Por: GORIO Engenharia");
mBuilder.setStyle(bigText);
mBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(getApplicationContext(),
MainActivity.class);
// The stack builder object will contain an artificial back
// stack for
// the
// started Activity.
// getApplicationContext() ensures that navigating backward from
// the Activity leads out of
// your application to the Home screen.
TaskStackBuilder stackBuilder = TaskStackBuilder
.create(getApplicationContext());
// Adds the back stack for the Intent (but not the Intent
// itself)
stackBuilder.addParentStack(MainActivity.class);
// Adds the Intent that starts the Activity to the top of the
// stack
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(100, mBuilder.build());
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句