autocompletetextview

how to combine both DISPLAY_NAME and NUMBER in a customized CursorAdapter?

喜欢而已 提交于 2019-12-10 15:57:30
问题 I want to load all of my contacts' names and phone numbers into an AutoCompleteTextView's adapter. How can I achieve that? for example, when i type "G", it will show "Good, <111111>", "Good, <222222>" in its drop-down list. with the api demo, i can only put the DISPLAY_NAMEs in the result cursor. I don't know how to combine both names and numbers into one cursor. thanks! codes from the api demo: ContentResolver content = getContentResolver(); Cursor cursor = content.query(ContactsContract

overriding filterresults in android autocompletetextview?

安稳与你 提交于 2019-12-10 14:28:55
问题 i've been pulling my hair over this a few days, I'm trying to setup an autocompletetextview in android where the user inputs a key and the autocomplete suggestions are the values, however I've tried this about 10 different ways now, extending BaseAdapter, SimpleAdapter and now ArrayAdapter, and I've noticed via the debugger that my resultset is fine, however I really have no idea what i'm supposed to be doing in the publishResults() section of the code. The first argument is custom

How to restrict AutoCompleteTextView dropdown dismiss?

穿精又带淫゛_ 提交于 2019-12-10 12:48:54
问题 I am working on a AutoCompleteTextView . I get some results when the users type in the AutoCompleteTextView and these are mandatory to select. But the problem is the drop down automatically dismisses when clicking on anywhere in the srceen. I want to avoid this. Is there any way I can achieve this. Thanks. 回答1: try the code below. I am using the the AutoCompleteText to auto complete the location where the user is currently in, the locationList is nothing but an array that i wrote in the

How to keep DropDownList of AutoCompleteTextView opened after pressing the Back key?

北慕城南 提交于 2019-12-10 07:58:59
问题 i am using AutoCompleteTextView in my Activity and i need it's DropDownList to be shown all the time (it's the only View in Window), even after Back key press. I need to dismiss soft keyboard instead. I tried to override Activity's onBackPressed method, but it's not used at all, so BackPressed event is being handled somewhere "higher". So i tried to find out where, but AutoCompleteTextView has no onBackPressed method defined. Any advices? 回答1: You can create your custom AutoCompleteTextView

Autocomplete textview google places api

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 17:33:17
问题 I followed this tutorial for doing the autocomplete textview using google places api. I want an autocomplete textview that automatically fills itself by the place names as we start typing. The above referred tutorial is exactly what I require but it is not working for me. The autofill action is not taking place.Can someone suggest a way out? Here is the main activity public class MainActivity extends Activity { AutoCompleteTextView atvPlaces; PlacesTask placesTask; ParserTask parserTask;

Android AutoCompleteTextView shows object information instead of text in landscape mode

女生的网名这么多〃 提交于 2019-12-09 15:04:54
问题 I am using a Custom Adapter with AutoCompleteTextView. It works fine on the emulator and my tablet. However, there is an issue on my phone in landscape mode. The auto complete hints being shown in this mode are object info rather than text. However, when I select any item the fields gets populated correctly with text in the respective fields. Auto Complete for other fields that are based on Android Stock Array Adapter works fine. Do I have to do something for this in my Custom Adapter? I saw

How can I avoid autocomplete dropdown appearing when text is programmatically set?

好久不见. 提交于 2019-12-09 07:57:15
问题 I have an AutoCompleteTextView in my layout. I also have an alternative way to select the same items which are present in the AutoCompleteTextView. When the alternative way is selected, I populate the value in the AutoCompleteTextView via: autoCompleteTextView.setText(valueFromAlternativeSource); where valueFromAlternativeSource is one of the valid auto complete options. The trouble with this is that the autocomplete dropdown appears when setText is called. Putting the following line after

Fetch AutoCompleteTextView suggestions from service in separate thread

。_饼干妹妹 提交于 2019-12-09 06:13:34
问题 For my AutoCompleteTextView I need to fetch the data from a webservice. As it can take a little time I do not want UI thread to be not responsive, so I need somehow to fetch the data in a separate thread. For example, while fetching data from SQLite DB, it is very easy done with CursorAdapter method - runQueryOnBackgroundThread . I was looking around to other adapters like ArrayAdapter , BaseAdapter , but could not find anything similar... Is there an easy way how to achieve this? I cannot

How to avoid getting both called: onItemClicked and onTextChanged on AutoCompleteTextView

為{幸葍}努か 提交于 2019-12-09 04:27:27
问题 I have this code. When I choose an item from suggestion list, the onTextChanged happens first, then oItemClicked comes after that. Now I want when choosing a word, the "onItemClicked" appears first, then "onTextChanged". I took a look Android doc but it doesn't mention this topic. package com.autocompletetest; import java.util.Arrays; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view

how to disable spell checker for Android AutoCompleteTextView?

谁都会走 提交于 2019-12-08 19:10:53
问题 I've searched for this problem but not found any answers for my case. I have an AutoCompleteTextView and some strings as suggestions (city names). Android marks them with red line. I think it's Android's spell checker. How can I prevent spell checking? 回答1: Found the best solution: android:inputType="textPhonetic" 回答2: I am not sure but You can use android:inputType="textNoSuggestions" to get rid of suggestions and android:autoText to false for autocompletetextview. The other possible way out