Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:46:29+00:00 2026-06-17T06:46:29+00:00

I am trying to implement TextWatcher on EditText . I used an EditText in

  • 0

I am trying to implement TextWatcher on EditText. I used an EditText in my app and watch it through TextWatcher.

When I type a alphabet like “a” in EditText bar my Cursor works but when I write next alphabet like “ab*” the cursor not works at all and on removing these letters errors occurred and my app crashes. I am unable to figure out what I am missing.

Here is my code:

TextWatcher myTextWatcher = new TextWatcher() {

    @Override
    public void onTextChanged(CharSequence s, int start, int before,
    int count) {

        if (start == 0) {


            SearchWordString.clear();

            Cursor cursor = managedQuery(DictionaryProvider.CONTENT_URI, null, null,
            new String[] {(search.getText().toString())}, null);



            while(cursor.isAfterLast()==false)
            {




                SearchWordString.add(cursor.getString(1)); 



                cursor.moveToNext();
            }



            listAdapter.notifyDataSetChanged();

            viewFlipper.showNext();
        } else {

        }

        listAdapter.notifyDataSetChanged();
    }

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

    }

    @Override
    public void afterTextChanged(Editable s) {





    }
};

And this is my LogCAT

01-15 04:54:25.080: W/dalvikvm(29324): threadid=1: thread exiting with uncaught exception (group=0x40b811f8)
01-15 04:54:25.103: E/AndroidRuntime(29324): FATAL EXCEPTION: main
01-15 04:54:25.103: E/AndroidRuntime(29324): java.lang.NullPointerException
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.ilmasoft.GPD.Start$2.onTextChanged(Start.java:1432)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.widget.TextView.sendOnTextChanged(TextView.java:8085)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.widget.TextView.handleTextChanged(TextView.java:8132)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:8495)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:892)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:389)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:266)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:443)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:216)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:29)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:90)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:45)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:151)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.method.QwertyKeyListener.onKeyDown(QwertyKeyListener.java:352)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.text.method.TextKeyListener.onKeyDown(TextKeyListener.java:132)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.widget.TextView.doKeyDown(TextView.java:5716)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.widget.TextView.onKeyDown(TextView.java:5531)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.KeyEvent.dispatch(KeyEvent.java:2608)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.View.dispatchKeyEvent(View.java:5547)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2021)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1382)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.app.Activity.dispatchKeyEvent(Activity.java:2324)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1948)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3360)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2618)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.os.Looper.loop(Looper.java:137)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at android.app.ActivityThread.main(ActivityThread.java:4511)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at java.lang.reflect.Method.invokeNative(Native Method)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at java.lang.reflect.Method.invoke(Method.java:511)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
01-15 04:54:25.103: E/AndroidRuntime(29324):    at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:46:30+00:00Added an answer on June 17, 2026 at 6:46 am

    It is my understanding that start is the first point in s that there is a change. Try not doing a check to see if start is 0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement iPhone like PIN-code authorization with 4 EditText blocks like this:
Just trying to implement mobFox into my app, but having trouble to make it
Trying to implement LoaderManager + CursorLoader. In onFinish method adapter should swap its cursor
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
So I've been trying to implement the TextWatcher for Android and ran into a
trying to implement the following but its not working <script> function loadmap(lat,lng) { //alert(lat,lang);
Trying to implement the new FP 10.1 Global error handler into my projects but
Trying to implement a similar approach towards our view counts for our web app.
Im trying to implement this example, but with $.getScript: and for some reason, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.