Create Custom Popup Window using Sketchware
Refer the video below if you get stuck.
1) Add a custom view named window.You can name it according to your wish.
2)Design your popup window.
2) Now, In the logic section,In OnCLick event of button.Add the following code
Create a view
View popupView = getLayoutInflater().inflate(R.layout.window, null);
Popup window
final PopupWindow popup = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
Initialize
Button b1 = popupView.findViewById(R.id.button1); Button b2 = popupView.findViewById(R.id.button2);
OnClickListeners
b1.setOnClickListener(new OnClickListener() { public void onClick(View view) { //below code will dismiss the popup window popup.dismiss(); } });
b2.setOnClickListener(new OnClickListener() { public void onClick(View view) {
popup.dismiss(); } });
Show the popup window
popup.showAtLocation(popupView, Gravity.CENTER, 0, 0);
It shows error... For line :
ReplyDeletedialog.setView(edittext1);
And the erorrs says that dialog cannot be resolved.
Type the correct name
DeleteChange dilog name with your dialog name
ReplyDeleteLike
dialog1.setView
how to sav it in variable
ReplyDeleteHow to do that when you enter one text was displayed another?
ReplyDeleteThis says: "cannot convert from editable to string"
ReplyDelete