0

I am implementing EditText programmatically, code is like this

private View createTextField(String schemaName, LinearLayout.LayoutParams params2, String fieldMaxLength) {
    final EditText editText = new EditText(mContext);
    //editText.setHint(field.getDisplayName());
    // set the layoutParams on the button
    editText.setLayoutParams(params2);
    editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, editTextSize);
    editText.setTypeface(Typeface.create("sans-serif-bold", Typeface.NORMAL));
    editText.setTextColor(getResources().getColor(R.color.edit_text_color));
    if (schemaName.equals("Notes")) {
        editText.setMaxLines(10);
        editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
    } else {
        editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
    }
    if (fieldMaxLength != null) {
        try {
            int maxLength = Integer.parseInt(fieldMaxLength);
            editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});
        } catch (NumberFormatException nfe) {

        }
    }
    return editText;
}

On long press I am getting the options for copy ,cut and paste but none of them is working.

[enter image description here

Please help me ,where i am doing wrong ?

Awadesh
  • 3,530
  • 2
  • 20
  • 32
  • I haven't time now to check your code but the links below may help you: http://stackoverflow.com/questions/6185676/cut-copy-paste-in-android; youtube: http://www.youtube.com/watch?v=jl8XYP3UJe8 – AsfK Oct 19 '15 at 18:16
  • thanks for the reply,can you tell me why on clicking the options for cut, copy , paste are not working, If you have any idea please help me – Awadesh Oct 19 '15 at 18:20

0 Answers0