How does WhatsApp popup notification work?

I am trying to emulate a WhatsApp popup notification. (If you have not seen this, it may be difficult for you to understand this.) The image below is for a clearer perspective.

whatsapp pop up notificaiton

Some have suggested that this can be done through ancillary activities that have a theme Theme.Holo.Light.Dialog.Alert . However, when I implemented this, I got half the activity, filled with views (and the other half), which should be empty, like a dialog showing a white background. those. I did not have a sense of dialogue.

More when the device is in standby mode (the power button is pressed) and locked, whatsapp can bypass this and show a pop-up dialog (or action or something else) above it.

Any ideas how to implement this?

+2
android notifications
source share
1 answer

Oh my God! A few hours later I found a solution!

Link: http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout

It is very simple, you just need to set up the activity theme on @android: style / Theme.Holo.Dialog in the manifest, for example:

 <activity android:theme="@android:style/Theme.Holo.Dialog" > 
+1
source share

All Articles