It is real tardily to display dialog to your application. Let’s foremost past times creating a novel android projection to demo custom warning dialog to your Android application amongst next information:
Application name: Custom Alert Dialog Example
Company Domain: viralandroid.com
Package name: com.viralandroid.customalertdialogexample
Minimum SDK: Android 2.2 (API 8 Froyo)
Modify Activity Layout File
Add a push to your activeness layout file. After adding push to your activity_main.xml file, it looks similar this.
Now, you lot bring to practice a novel xml file inward your layout directory to demo custom dialog inward your app. Your custom dialog layout volition hold off similar this.
Modify Your Java Activity
Here is modified coffee code of MainActivity.java file.
Now, hold out your application as well as click Show Custom Alert Dialog push in that place is a dialog appeared which similar below.
|Android Alert Dialog Box|