public void editTextInfoOnClick(View view) { String transportList = options.getTransportList(); if (transportList != null && !TextUtils.isEmpty(transportList)) { EditText et = (EditText) findViewById(R.id.editTextInfo); Editable data = et.getText(); Matcher m = transportListPattern.matcher(data); if (!m.matches()) { et.setText(transportList); } } }