versuchen dieses
NotificationManager notificationManager = (NotificationManager)
getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this);
// call your local image location
mBuilder.setSmallIcon(R.mipmap.app_icon);
// if you want to set image from url then use it
mBuilder.setSmallIcon(R.mipmap.app_icon).setLargeIcon(getBitmapFromURL("image url"));
public Bitmap getBitmapFromURL(String strURL) {
try {
URL url = new URL(strURL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
Ich bin nicht eine lokale Meldung Es ist ein GCM-Push-Benachrichtigung erstellen, Attribute müssen wieder auf dem Server –
Prüfung identifiziert werden, ich habe meinen Code bearbeitet – anu
U immer noch nicht git es ist der Code für die lokale Benachrichtigung, meine Frage ist über Push-Benachrichtigung, es ist serverseitige Implementierung ist nicht einmal geschrieben Java –