AlertDialog via Fragment: Android Programming

۸.۵ K


۵

Create an AlertDialog using AppCompatDialogFragment. Interact with the parent activity by setting text in a TextView, and by closing it with .finish(). Support videos via Patreon: https://www.patreon.com/DrBFraser Steps: - Setup MainActivity with a TextView to edit, and a button to trigger the dialog box. - Create a layout XML file for the dialog's appearance - Create a Java class inheriting from AppCompatDialogFragment to build the AlertDialog - Show the AlertDialog from main using a fragment manager. - Add a cancel button - Call .finish() on the parent activity to close it.

منتشر شده توسط: Brian Fraser
تاریخ انتشار: ۲ سال پیش
دسته بندی: آموزشی