Android Suggestion TextField - android

I'm trying to design a user form and I was wondering if it's possible to create a TextField that when the user clicks on it a dropdown list appears with suggestions ( based on previous values entered by the user )
and the user has the choice to either pick on of the suggestions or writes his own in the text field .
Thank you

You can Use AutoCompleteTextView
An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
Check Demo android_auto_complete

Related

How to show keyboard type in numbers in one row in ipad or tab(not multiple rows)

i have implemented keyboard type number but problem is it is showing bottom center of tab with 4 rows.what i want is to show keyboard in one row only.not mutiple row.
You don't get to make that choice. The keyboard is its own app in Android, and it decides what keys are displayed. You can give it a hint from the type of the field, such as number or email. But the final decision on what and how to display is the keyboard app's.

Open Search Suggestion Fragment in full screen when the edit text is selected

I have a situation where the search box can be anywhere on the screen, once the user select the search box, i want show the Search Suggestion fragment on full screen, i populate the suggestion list as the user types in, on done i want to close the fragment and populate the selected text on the search box, similar to google PlaceAutocompleteFragment. what are the building blocks i need? thank you in advance, this is my first question sorry if there are any formatting issue in my question
Was able to do it by designing transparent screen with EditText on screen. and start activity for results on Parent activity EditText onfocus

Default text in the serach bar with AutoCompleteTextView

I'm using the AutoCompleteTextView to allow users to search a from a list of countries. I want to have some default text preloaded in the search bar before the user clicks on it, such as "Search" or "Find Nearest Country". Is it possible to do this? If so how?
Right now, the app opens directly into the search box with the keyboard pulled up. Rather, I want the users to click on the bar before searching.
http://developer.android.com/reference/android/widget/AutoCompleteTextView.html
A TextView's hint seems to be exactly what you need. See android:hint for the XML attribute or setHint() for the corresponding Java method.
To prevent the keyboard from popping as soon as your activity is entered, you should set the android:windowSoftInputMode attribute in the activity declaration to stateHidden.

SearchView or EditText is better for search bar function?

I wanted to know whether using the SearchView widgit or the EditText widgit with a Button widgit was a better implementation of a search bar I wanted to create (a search bar meaning you type in a word and u click go and it'll take you to some sort of result).
Its depends on your requirement of your database is huge that the hint results cant be displayed in single screen then better to use edit-text with a go button for search.if you have limited data in list-view or something you can use edit search box.

Auto complete text remaining on screen

Does anyone know why the search text remains on the bottom of screen (as shown in image below). Steps to get there:
Choose to search for location
qwerty keyboard comes up
auto complete bar appears above qwerty
hit "Done" and the auto complete text remains on screen and relocates to bottom, but search is called
. This does not happen all the time.
With KeyEvent.ACTION_UP the search text "sticks" to screen when clicking "Done" ... goes directly to search
With KeyEvent.ACTION_MULTIPLE, "Done" closes the qwerty and user must click search button to begin search
If you want any word, I think the keyboard do that with predictive text. If only want a list of items ( only countries ) you should use a Spinner.

Categories

Resources