EditTextをつかっていて、特定の文字が入力された時になんかアクションを起こしたい、ってなった時はTextWatcherクラスを継承した新しいクラスを作って、そのインスタンスをEditTextのアクションリスナーに流せばいい。
onCreateとかの中で
editText.addTextChangedListener(new UITextWatcher ()) クラス内でオーバーライド public class UITextWatcher implements TextWatcher { public void afterTextChanged(Editable arg) {} public void beforeTextChanged(CharSequence s, int start, int count, int after) {} public void onTextChanged(CharSequence s, int start, int before, int count) {} }
んでEditText内を編集すると毎回onTextChangedが呼ばれて、その内容がCharSequence sなので、それに対して色々やってやればいい。
例えば"#"が入力された時にダイアログを出したい、とかだったら
sに#が入ってるか調べて…みたいな。