Source:
<code>protected StringWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride) { super(context, prompt); answerText = new EditText(context); answerText.setId(ViewIds.generateViewId()); readOnly = prompt.isReadOnly() || readOnlyOverride; answerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, getAnswerFontSize()); TableLayout.LayoutParams params = new TableLayout.LayoutParams(); String height = prompt.getQuestion().getAdditionalAttribute(null, ROWS); if (height != null && height.length() != 0) { try { int rows = Integer.parseInt(height); answerText.setMinLines(rows); answerText.setGravity( Gravity.TOP); } catch (Exception e) { Timber.e("Unable to process the rows setting for the answerText field: %s", e.toString()); } } params.setMargins(7, 5, 7, 5); answerText.setLayoutParams(params); answerText.setKeyListener(new TextKeyListener(Capitalize.SENTENCES, false)); answerText.setHorizontallyScrolling(false); answerText.setSingleLine(false); String s = prompt.getAnswerText(); if (s != null) { answerText.setText(s); Selection.setSelection(answerText.getText(), answerText.getText().toString().length()); } if (readOnly) { answerText.setBackground(null); answerText.setEnabled(false); answerText.setTextColor(themeUtils.getPrimaryTextColor()); answerText.setFocusable(false); } addAnswerView(answerText); answerText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { <START> widgetValueChanged(); <END> } }); }</code><technical_language>call this method in clearAnswer() well</technical_language>

Target:
protected StringWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride) { super(context, prompt); answerText = new EditText(context); answerText.setId(ViewIds.generateViewId()); readOnly = prompt.isReadOnly() || readOnlyOverride; answerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, getAnswerFontSize()); TableLayout.LayoutParams params = new TableLayout.LayoutParams(); String height = prompt.getQuestion().getAdditionalAttribute(null, ROWS); if (height != null && height.length() != 0) { try { int rows = Integer.parseInt(height); answerText.setMinLines(rows); answerText.setGravity( Gravity.TOP); } catch (Exception e) { Timber.e("Unable to process the rows setting for the answerText field: %s", e.toString()); } } params.setMargins(7, 5, 7, 5); answerText.setLayoutParams(params); answerText.setKeyListener(new TextKeyListener(Capitalize.SENTENCES, false)); answerText.setHorizontallyScrolling(false); answerText.setSingleLine(false); setDisplayValueFromModel(); if (readOnly) { answerText.setBackground(null); answerText.setEnabled(false); answerText.setTextColor(themeUtils.getPrimaryTextColor()); answerText.setFocusable(false); } addAnswerView(answerText); answerText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { widgetValueChanged(); } }); }