2013-04-03 17 views
7

私はEditTextを入力している間に、私のアプリでいくつかのStringにテキストを取得し、それを活発に表示するために(別のViewで)グーグルのライブ/インスタント検索は作品と同じように...EditText - 入力時にEditTextからテキストを取得

+3

http://mattgemmell.com/2008/12/08/what-have-you-tried/ – ruben

答えて

26

あなたはTextWatcherを探しています:

youredittext.addTextChangedListener(new TextWatcher() 
    { 
     @Override 
     public void afterTextChanged(Editable mEdit) 
     { 
      text = mEdit.toString(); 
     } 

     public void beforeTextChanged(CharSequence s, int start, int count, int after){} 

     public void onTextChanged(CharSequence s, int start, int before, int count){} 
    }); 
+0

ありがとうございました!完璧に動作します! –

関連する問題