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

  • SEARCH
  • Home
  • 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 3273516
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:56:24+00:00 2026-05-17T18:56:24+00:00

I have an AutoCompleteTextView with a MatrixCursor as an adapter. The AutoCompleteTextView has a

  • 0

I have an AutoCompleteTextView with a MatrixCursor as an adapter. The AutoCompleteTextView has a OnItemClickListener as follows:

public class AutoCompleteListClickListner implements OnItemClickListener
{
    private AutoCompleteTextView acView;

    public AutoCompleteListClickListner(AutoCompleteTextView view)
    {
        this.acView = view;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
    {
        /* tv is the selected view in the dropdown */
        TextView tv = (TextView) ((LinearLayout) view).getChildAt(0);
        Log.d(AndroidLogTag, "Before:>>>>" + this.acView.getText().toString());
        this.acView.setText(tv.getText().toString());
        Log.d(AndroidLogTag, "After:>>>>" + this.acView.getText().toString());
    }
}

When an item is selected I see following in the log

10-14 00:34:37.893: DEBUG/MyApp(19151): Before:>>>>android.database.MatrixCursor@4643e388
10-14 00:34:37.912: DEBUG/MyApp(19151): After:>>>>Ankit V Jain

If you see the log, the Before log entry, the getText() returns a SpannableStringBuilder object and toString() of it returns some object identifier.

How do I get actual text of the auto-complete view which was there just before clicking drop-down item?

  • 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-05-17T18:56:25+00:00Added an answer on May 17, 2026 at 6:56 pm

    Well, there is always another way (dirty or best) in code.

    I added a TextWatcher to the AutoCompleteView and used beforeTextChanged() event to record text content and reuse that in onItemClick() !

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

Sidebar

Related Questions

I have a AutoCompleteTextView and a custom AutoCompleteTextView adapter. my list has 20 items
I have this Autocomplete class and I am modifying the adapter so that, instead
I have AutoCompleteTextView attached to my view, and used ArrayAdapter to populate for list
have written this little class, which generates a UUID every time an object of
I have an Activity with an AutoCompleteTextView and a ListView with an adapter that
First summary: class A extends AutoCompleteTextView { public A() { setOnKeyListner( ... new OnKeyLisnter()
I have created a custom view by extending AutoCompleteTextView (with a specialized function called
Does anyone know if it's possible to have the adapter for an AutoCompleteTextView search
I want to know if this is possible using Android's XML: I have AutoCompleteTextView
I'm making my own search view for Android 2.3. I have. LinearLayout (Horizontal) AutoCompleteTextView

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.