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.
[
Please help me ,where i am doing wrong ?