EditText paste Unable - Android User Interface

Android examples for User Interface:EditText

Description

EditText paste Unable

Demo Code


//package com.java2s;
import android.annotation.TargetApi;
import android.os.Build;

import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;

import android.widget.EditText;

public class Main {

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public static void pasteUnable(EditText editText) {
        editText.setCustomSelectionActionModeCallback(new ActionMode.Callback() {
            public boolean onCreateActionMode(ActionMode actionMode,
                    Menu menu) {//  ww  w  . j  ava 2  s .c o m
                return false;
            }

            public boolean onPrepareActionMode(ActionMode actionMode,
                    Menu menu) {
                return false;
            }

            public boolean onActionItemClicked(ActionMode actionMode,
                    MenuItem menuItem) {
                return false;
            }

            @Override
            public void onDestroyActionMode(ActionMode mode) {

            }
        });
        editText.setLongClickable(false);
    }
}

Related Tutorials