Reputation: 11
I'm working on an app, in that i create a class for calender view. Now I want to open that calender activity as a pop up, I don't know how to create popup actually, so I do google and got following code, but that code open only the ui of the calender class. So can anybody tell me how can I do this?
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
LayoutInflater layoutInflater
= (LayoutInflater)getBaseContext()
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.my_calendar_view, null);
final PopupWindow popupWindow = new PopupWindow(
popupView,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setWidth(200);
popupWindow.setHeight(500);
popupWindow.showAsDropDown(b, 500, 30);
}
});
}
Upvotes: 1
Views: 2724
Reputation: 570
android:theme="@android:style/Theme.Dialog
In your Manifest File, in activity block of your class name add the above statement
Upvotes: 2