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 9271379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:36:22+00:00 2026-06-18T15:36:22+00:00

I am using AutoCompleteTextView in my application but it works unexpectedly. AutoComplete list show

  • 0

I am using AutoCompleteTextView in my application but it works unexpectedly. AutoComplete list show the unwanted text from list which i am not looking for but when i selected this text and remove focus from autocomletetextview than it set the proper text to the autocompletetext field. The other problem is that i want to gain the id of the selected text in the autocompletetext field i am associating this id when i am populating a list in the custom adaptor for autocompletetextview.
Here is the code i am using.

autoComMarker = (AutoCompleteTextView) findViewById(R.id.auto_rainfall_of_markaz_id);
autoComMarker.setThreshold(1);
CustomMarkazAdapter adapter = new CustomMarkazAdapter(getBaseContext(),     R.layout.custom_auto_com_listview, marqazList);
autoComMarker.setAdapter(adapter);


autoComMarker.setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView<?> arg0, View view,
                int position, long arg3) {
            autoComMarker.setTag(view.getTag());
            Log.e("Markaz list", ""+view.getTag());
        }
    });

Here is the code for CustomMarkazAdapter:

public class CustomMarkazAdapter extends ArrayAdapter<Markaz>{

private ArrayList<Markaz> items;
private Context CurrentContext;
private Markaz CurrentItem;

public CustomMarkazAdapter(Context context, int textViewResourceId,
        ArrayList<Markaz> objects) {
    super(context, textViewResourceId, objects);

    items =  objects;
    CurrentContext = context;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {

     if ((items == null) || ((position + 1) > items.size()))
        return convertView; //Can't extract item

   CurrentItem = (Markaz)items.get(position);    

    LayoutInflater vi = (LayoutInflater)CurrentContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView = vi.inflate(R.layout.custom_auto_com_listview, null);      
    TextView text = (TextView) convertView.findViewById(R.id.custom_auto_com_text);

    text.setText(CurrentItem.getMarkazName());
    convertView.setTag(CurrentItem.getMarkazID());
    Log.e(CurrentItem.getMarkazName(),""+CurrentItem.getMarkazID());
    return convertView;
}

}

The markazID i am setting here is not that i am looking for, its sets the markaz id according to the autocompletelistview item position.which i am not needed i need the markaz id which i am passed with the markazList.
Please help me, any help whould be very appreciated.

  • 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-18T15:36:24+00:00Added an answer on June 18, 2026 at 3:36 pm

    Try this.

      autoComMarker.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View view,
                        int position, long arg3) {
                   Markaz items= adapter.getItem(position);
                   //Now you can get items of Markaz from items.get...
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Asynctask to retrieve the list from server in autocompletetextview but i
I'm building an application in which I need to bring auto suggestion using autocompletetextview,
I am using an AutoCompleteTextView but am running into the problem of white text
I am using a AutoCompleteTextView in my code and loading the list from database
I'm using an AutoCompleteTextView in my Android application, which is loaded with items like
I'm using an AutoCompleteTextView with an ArrayAdapter which works like supposed. The problem is,
I was doing some stuff using autocomplete textview in my application. I'm getting suggestion
I'm using Android's AutoCompleteTextView with a CursorAdapter to add autocomplete to an app. In
Using C# How can I show a document in richtextbox without scrollbars, But I
I have created an app which retrieves the data from a url using xml

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.