Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification like whatsapp or sms app android

I want to create a Notification view just like whatsapp or sms notification.How can i achieve that.

enter image description here

What I have search till now

Crouton : Can found here

this will show a crouton at running activity and below to the action bar. if my activity not running or i am on the other activity how can this handle.

Toast: this is not looking like a toast. It show only on bottom or center .

Dialog: this can be done like this but this will blur the application. and disable the background. And i don't want this

Any solution will appreciated.

Thanks

like image 384
shailesh Avatar asked Sep 29 '15 13:09

shailesh


People also ask

What are Android app notifications?

An app notification is a message or alert sent by an application to the device user.


1 Answers

it's a headsup notification works from android lollipop here you check how to show notification you can see here http://developer.android.com/guide/topics/ui/notifiers/notifications.html and for headsup you have to set notification priority as below

.setPriority(Notification.PRIORITY_HIGH)

hope it helps

EDIT Nov-17

Notification.PRIORITY_HIGH was deprecated in API level 26. use (NotificationManager.IMPORTANCE_HIGH) instead.

like image 188
Pavan Avatar answered Oct 23 '22 18:10

Pavan