Creating a Pop-Up Dialog

ID - _BUGFISH - E#49
^Top
<< Back
Mobile-Menu










Creating a Pop-Up Dialog
Category: Android-Java
Sub-Category:
Creator: Jan-Maurice Dahlmanns
Created: 2020-09-02 07:12:25
Modified: 2024-11-17 00:29:50
Views: 733

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.

Dialog XML File:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
        tools:ignore="UselessParent">

                <!-- ENTER YOUR ELEMENTS HERE! -->

        </LinearLayout>
    </LinearLayout>
</RelativeLayout>

Code to show Dialog XML in your Activity:

final Dialog dd = new Dialog(ACTIVITY.this);
dd.setTitle("TITLE");
dd.setContentView(R.layout.XMLSHEETABOVE);
// OTHER CODE HERE
dd.show();

If you want to close the Dialog use:

dd.dismiss();

Currently 0 Upvotes!

captcha image
System - 2024-11-05 18:27:50
Commenting System Initialized! Have a very nice day!

Switches: 0 | Arrivals: 4 | Visits: 4
This Website is using Session Cookies for Site Functionality.