0

I've one seen on an application for iPhone an interesting idea which consists of showing a list of options when we click on an area for text edition. For example, imagine I have a field called "City" (EditText) which I am suposed to enter the name of the city. When clicking on the EditText, a list automatically shows up with a few city suggestions (e.g. defined by the programmer) which can be selected. If the user doesn't like the suggestions, he writes the city himself and this city can be saved for this list for future.

I want to programme this on my App for android. I need that, when clicking on the EditText for introducing the data, a list automatically shows up with some suggestions defined by me (Programmer). However, I don't know how this can be done. I've googled but maybe it's hard to find the correct keywords to find a similar topic.

The idea is that the user should use the names already written in the list in 90% of the time and just write himself the new ones when it's necessary. Something like a dropdown list but with possibility of writing new stuff instantly without specific option.

How can this be achieved?

filipehd
  • 900
  • 3
  • 13
  • 30

2 Answers2

0

You Need Something Like View in android Named as

AutoTextComplete

Examples How to use this :

help

Best of luck

Community
  • 1
  • 1
Muhammad Omer
  • 229
  • 2
  • 11
  • I don't want AutoText Completion. I want just suggestions to be shown. And everytime the user types something which is not on the List, this is automatically saved in the list. The idea is that the user should use the names already written in the list in 90% of the time and just write himself the new ones when it's necessary. Something like a dropdown list but with possibility of writing new stuff instantly. – filipehd Sep 02 '13 at 13:34
  • Then yes, you do want to start with an AutoTextCompleteTextView - with a custom adapter and filter to show the list of predefined & user specified cities (user doesn't have to start typing before options are shown). The adapter would have to link to some persisted list (/ database) that is updated if the user enters a new city. – FunkTheMonk Sep 02 '13 at 14:53
0

You can consider focus changed listener for Edittext, when focus is gained you can show a context menu to choose data from.

Pankaj
  • 1,242
  • 1
  • 9
  • 21
  • okay, but must also be the option to write the text. What i've seen on iPhone was sth like that. You can write or either choose from some kind of menu which appears under the EditText. I am afraid that by choosing a context menu I will lose the possibility to write on the edittext – filipehd Sep 02 '13 at 21:31