I want to create an app that will show internet speed as notification in status bar
the problem is that when i create notification it only shows icon but i think this is not the way (if you think there is a way using this then how ?
) i used this codes snippet to show notification but what changes to do if i want the result that others are getting as you can see also in screen shot in the leftmost side
:
Intent intent = new Intent(this, MainActivity.class);
PendingIntent contenIntent = PendingIntent.getActivity(this,
0, intent, 0);
NotificationCompat.Builder notification = new NotificationCompat.Builder(this, CHANNEL_ID_2)
.setLargeIcon(getBitmapFromString("22", 20, this))
.setContentTitle("Title")
.setContentText("Description")
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setContentIntent(contenIntent)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setTicker("23")
.setSmallIcon(android.R.drawable.screen_background_light_transparent)
.setOnlyAlertOnce(true);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
notificationManager.notify(1, notification.build());
The text changes in notification per second and it is not fake.
I have already tried this solution but not accurate since it overlaps with notification icon.
Any help
will be appreciated thanks in advance.