Ich möchte eine GCM-Benachrichtigung anzeigen, die einen Titel, eine Nachricht und ein großes Symbol im Sperrbildschirm enthält. Das Bild und der Titel kommen von meiner App, wobei der Titel der Name meiner App ist und die Benachrichtigung zu einem Signaldienst gehört.GCM Notification Title und Nachricht in LockScreen (Android)
Ich möchte die Benachrichtigung wie unten Benachrichtigung auf dem Bild machen.
Dies ist mein Code:
protected void onHandleIntent(Intent intent) {
Bundle extras = intent.getExtras();
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
String messageType = gcm.getMessageType(intent);
GcmBroadcastReceiver.completeWakefulIntent(intent);
mNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), 0);
Bitmap small_Icon = getBitmapFromURL((String) extras.get(Config.SMALLICON_KEY));
Bitmap large_Icon = getBitmapFromURL((String) extras.get(Config.LARGEICON_KEY));
Bitmap Poster = getBitmapFromURL((String) extras.get(Config.BIGPICTURE_KEY));
String title = (String) extras.get(Config.TITLE_KEY);
String message = (String) extras.get(Config.MESSAGE_KEY);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this).setSmallIcon((R.drawable.ic_launcher))
.setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(Poster)
.setBigContentTitle(title)
.setSummaryText(message))
.setContentTitle(title)
.setContentText(message)
.setLargeIcon(large_Icon);
//////// Play Defult Notification Sound ////////
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
//////// End Play Defult Notification Sound ////////
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
Log.d(TAG, "Notification sent successfully.");
}
Irgendwelche Ideen?