0

How do you disable the OnLongClick event on an edit text?

I did try the following things:

editText.cancelLongPress();

also

editText.setOnLongClickListener(null);

and also the

editText.setOnLongClickListener(new OnLongClickListener() {

            @Override
            public boolean onLongClick(View v) {
                // TODO Auto-generated method stub
                return false;
            }
        });

But nothing worked. Help please.

4

1 回答 1

2

Try this if it can help you :

         <EditText
            android:id="@+id/editText2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10"
            android:longClickable="false" />
于 2013-05-13T11:12:03.657 回答