Android popup message

im application development.

I want to create a popup that will be stable until we close ...

I want some tutorial to help me make the alertDialog field.

Thanks in advance.

+3
source share
3 answers

I think you are looking for a Dialog so that you can show the user an Alert message confirming the message, etc.

For more info see this: http://developer.android.com/reference/android/app/Dialog.html ,

Here is a good example in the Warning dialog: http://www.androidpeople.com/android-alertdialog-example/ .

From the commented code:

AlertDialog.Builder alt_bld = new AlertDialog.Builder(this).create();     
alt_bld.setMessage("apprika target achieve...");
alt_bld.setCancelable(false);
alt_bld.setPositiveButton("yes", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } });
alt_bld.setNegativeButton("No", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub dialog.cancel(); } }); 
alt_bld.show();

Alert Click alert.show(); .

+7
AlertDialog.Builder(AlertDialogSamples.this)
                .setIcon(R.drawable.alert_dialog_icon)
                .setTitle(R.string.alert_dialog_two_buttons_title)
                .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {

                        /* User clicked OK so do some stuff */
                    }
                })
                .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {

                        /* User clicked Cancel so do some stuff */
                    }
                })
                .create();
+1

you should look for Dialog .

Tuturial1

Tutorial2

This will help you.

+1
source

Source: https://habr.com/ru/post/1792982/


All Articles