Custom Popup Window Example

Description:
This example shows how you can create and customize a popup window.

Algorithm:

1.) Create a new project by File-> New -> Android Project name it CustomPopupWindowExample.
2.) Write following into your main.xml file:

 

 

 

3.) Create and Write following into your popup.xml:

 

 

 

4.) Create anim folder into your res directory, create popup_hide.xml and write following:

 

 

 

5.) Create popup_show.xml into anim folder and write following:

 

 

 

6.) Create button_bar_gradient.xml into drawable folder and write following:

 

 

 

7.) Create button_close.xml into drawable folder and write following:

 

 

 

8.) Create and write following into TransparentPanel.java:

 

 

 

9.) Run for output.

Steps:

1.) Create a project named CustomPopupWindowExample and set the information as stated in the image.

Build Target: Android 2.3.3
Application Name: CustomPopupWindowExample
Package Name: com.example
Activity Name: CustomPopupWindowExample
Min SDK Version: 10

2.) Open CustomPopupWindowExample.java file and write following code there:

 

 

 

3.) Compile and build the project.

Output

Leave a Comment:

7 comments
NIKHIL RAJ L R says April 29, 2012

Thanks Alot..!! grt one!! loved edumoble.org

Thanks 🙂

Reply
NIKHIL RAJ L R says April 29, 2012

Thanks Alot..!! grt one!! loved edumoble.org

Thanks 🙂 🙂

Reply
Jiya says April 30, 2012

this code is not working…
In main activity class,TranparentPanel object is creating null pointer exception..

Reply
Jiya says April 30, 2012

this code is not working…
In main activity class,TranparentPanel object is creating null pointer exception

Reply
Jim says June 19, 2012

Man you have done a great job thanks for this awesome example. Keep up the excellent work

Reply
ashok says February 1, 2013

This is not working in Galaxy SIII

Reply
Ahmad says June 22, 2013

Awesome,
Thank you.. It works for me..

Reply
Add Your Reply