EditText – Get text from EditText while typing

I want to get the text into some String in my app while the user is typing in the EditText and use it to lively show it on the activity (in different View…) – Just like google’s live/instant search works…

  • Is there a way to check if a TextView's text is truncated
  • How to center drawableTop and text vertically on the Button in Android?
  • How to check if camera is opened by any application
  • max file name length in Android
  • org.apache.http.client.ClientProtocolException
  • Nested tabs with viewpager swiping in android?
  • Related posts:

    AlertDialog with positive button and validating custom EditText
    Error android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x1020...
    Difference between ActionBarActivity and Fragment Activity
    Edittext set for password with phone number input? (android)
    Bambuser ffmpeg - “arm-linux-androideabi-gcc is unable to create an executable file.&r...
    Checking username and password in Android
  • Return data from AsyncTask Android
  • What permission do I need to access Internet from an android application?
  • Converting TextView to String (kind of) Android
  • Passing RecyclerView CardView Clicked Item Data To Activity
  • BroadcastReceiver when wifi or 3g network state changed
  • Drawing 2 circles on a canvas
  • One Solution collect form web for “EditText – Get text from EditText while typing”

    You are looking for 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){}
        });
    
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.