Monday 3 September 2012

PopupWindow For Android

A popup window that can be used to display an arbitrary view. The popup windows is a floating container that appears on top of the current activity.Developer site link

Here we are using LayoutInflater for displaying the popupwindow objects. According to our requirements we will create the xml for popupWindow.

Here is the code lines:
LayoutInflater layoutInflater
= (LayoutInflater)getBaseContext()
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup, null);
final PopupWindow popupWindow = new PopupWindow(
popupView,
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT); 

ScreenShot:

  
 

No comments:

Post a Comment