I need to create a popup window with buttons and a button that will close the popup. I found some tutorials but I couldn't find out how to do the implementation.
What I want to do: Click an action button and the popup shows and when I click the the close button the popup window must close.
There were an onCreate method in the tuorials and I didn't understand how is it called.
Can somebody give an example of an popup implementation or a link to a good tutorial? Thank you!
private void showPopup(){
Button btn_closepopup=(Button)layout.findViewById(R.id.btn_closePoppup);
pwindo=new PopupWindow(layout,480,500,true);
pwindo.showAtLocation(layout, Gravity.CENTER, 0, 40);
chartContainer1.addView(mChart);
btn_closepopup.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
pwindo.dismiss();
}
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With