Android examples for android.text:Editable
replace All Text from Editable
//package com.java2s; import android.text.Editable; import android.text.InputFilter; public class Main { public static void replaceAllText(Editable editable, CharSequence newString) { InputFilter[] filters = editable.getFilters(); editable.setFilters(new InputFilter[] {}); // We need to remove filters so we can add text with spaces. editable.replace(0, editable.length(), newString); editable.setFilters(filters);/* www. j a v a2s .com*/ } }