1

Action Bar Select All/Cut/Copy not showing for EditText in Alert dialog(picture 2),Kindly help

enter image description here

enter image description here

Edit: the code is

            View view = MainActivity.this.getLayoutInflater().inflate(
                    R.layout.custom_dialog, null);
            AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                    MainActivity.this);
            alertDialogBuilder.setView(view);
            alertDialogBuilder.setPositiveButton("Add",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,
                                int whichButton) {

                        }
                    });
            alertDialogBuilder.setNegativeButton("Cancel",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,
                                int whichButton) {
                        }
                    });
            Dialog d = alertDialogBuilder.create();
            d.show();
Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
Nasrudeen
  • 425
  • 5
  • 18

1 Answers1

2

What API level is the 2nd screen cap from?

Potential answer here: How do I enable standard copy paste for a TextView in Android?

Read emil10001's comment.

Community
  • 1
  • 1
Stan Smith
  • 896
  • 7
  • 19
  • It seems not api problem,because i am using higher version api,it works for dialog and not for alertdialog,posted my code above ,kindly have a look – Nasrudeen Feb 26 '14 at 03:09
  • Thanks. You may need to create a subclass of AlertDialog so you can override onCreateContextMenu() check this entry: http://stackoverflow.com/questions/4174793/please-help-me-set-up-a-context-menu-in-an-alertdialog – Stan Smith Feb 26 '14 at 17:26
  • I just found ,when we use Dialog(Not AlertDialog) we can get this cut/copy ContextMenu by default and for positive and negative button for the Dialog use http://stackoverflow.com/questions/5735423/alertdialog-style-buttons-for-an-activity/18321501#18321501 – Nasrudeen Aug 22 '14 at 04:55