Popup layer

Hello guys,
Here is the codes for popup layer. The problem is that it is not being removed.
I have created a popup layer and I call below method.

public void PopupRaise(){

	 Element popupElement = nifty.createPopup("PopupRaise");
	 nifty.showPopup(nifty.getCurrentScreen(), popupElement.getId(), null);
	 else if(flag==1)
		// Element popupElement = nifty.createPopup("PopupRaise"); 


First,when I press a button that calls above method, the popup window appears. The popup window contains a textfield and a button to exit popup layer. But When I press that exit button, it is not being removed.
Please help on this.

You are creating a new element with a different id each time your method is called.

1 Like