CodePudding user response:
AlertDialog. Builder Builder=new AlertDialog. Builder (context);
The View viewDialog=the inflate (context, R.l ayout. Dialog_plans_details, null);
Builder. SetView (viewDialog);
Final AlertDialog AlertDialog=builder. The create ();
AlertDialog. The create ();
AlertDialog. The show ();
So you can when you want to call dismiss with alertDialog. Dismiss will be OK