PopupDialog.java
unknown
java
4 years ago
677 B
11
Indexable
package com.example.test; import android.app.Dialog; import android.content.Context; import androidx.annotation.NonNull; public class PopupDialog extends Dialog { private Context context; private String title; public PopupDialog(@NonNull Context context, String some_title) { super(context, R.style.NoActionBarDialog); // Call setTitle function of the Dialog class to set the title this.setTitle(title); } @Override public void onBackPressed() { //do nothing <----- only this if you want to forbid the user to exit the dialog with the back button, // ↓ // else don't override this method } }
Editor is loading...