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?
You Need Something Like View in android Named as
AutoTextComplete
Examples How to use this :
help
Best of luck
You can consider focus changed listener for Edittext,
when focus is gained you can show a context menu to choose data from.
Related
first of all I want to thank, because in this community I have found a lot of solutions to my development question. But this time I have a big one. I was looking for an answer to it in google and pdf´s and so on. But it's a complicated question and don't know how exactly ask for it in google. I new in app development. so here I go. I'm trying to do an app that shows the different recipes with photos and description like time that it takes and the difficulty and so.
explanation of the question
Apologize because the childish imagen to explain to you but you know (efficiency).
My two questions are:
1) How may I do to attach a description to an image. I mean, I want that the people can add their own recipes and of course I will make a formulary to this, but how may I do to when the people create the recipe that I suppose that it should be an object of a class, the TextView be attached to the bottom of the image automatically. in resume, that the image and the description with their elements be one unique element. I have tried to encapsulate the image and the text view in one layout, but in this case I don't know how to create a new layout once the app is running. ok the user fill the formulary but how to create a new layout on the run. I don't know how to solve this.
2) How may I do to change in the description of the image the quantity of red tomatoes. I mean. if the recipe have 3 in difficulty, 3 of 5, this is settled by the user, but how I do to show 3 red tomatoes of 5 and the other showed in gray?
I know you may say "another Newby" but I have realized that I love programming and in El Salvador (Central America) there´s almost any information about this subject. Again, thanks a lot.
one way to achieve that is by using Recycler view. and every time a user adds an item. you can add it to the list and the system will draw a new item for you.
check this tutorial
let me know if this helps or you need more explanation
I want to create something similar to a listpreference menu item with a single selectable option out of four options. The problem is that descriptions are necessary for each selectable option and they are rather long. Shortening descriptions further isn't an option.
The Android app I'm working on currently uses a custom method for displaying a menu item's summary field. The summary calls an int which points to a string reference stored in a different file that displays a string. I tried using %s as the summary to update the summary with my selected option but that literally returned "%s". I don't think the current method supports dynamically loading summaries.
My next idea is to create a submenu with four selectable choices (maybe checkboxes?) and only allow one to be chosen. I think this is essentially a listpreference menu item but allows more space for separated descriptions. Is there a preferred way to accomplish this? I'm trying to avoid re-writing the original custom method for displaying descriptions as it works well for the rest of the app's menu needs.
EDIT 1: An image will help explain what I want. See Android sample settings menu. I want to create a section similar to the "embedded frame buffer" section in a submenu except only one of the three options are selectable. This approach will allow me to have more room for separated, long descriptions. Perhaps I'm looking for radio buttons with no popup and one selectable choice? Is this a thing in Java?
Not sure if I understand the question correctly but instead of a list of checkboxes where only one checkbox is checkable use a RadioGroup with Radiobuttons. You can have multiple RadioButtons which you add to a RadioGroup and then only one RadioButton can be selected.
I have a Text field that when you write, autocompletes with the possible choices you have based on what you are writing.
There's a fixed list of favorite choices, and I have to add a checkbox to the component so the user can choose whether to see only the favourite choices or all the possible choices.
I asked google, but I can't find how to modify a component at that level.
Does anybody have hints or somewhere I can take a look at a good example?
Add an AjaxCheckBox next to the text field. When the autocompleter asks the server for values use the AjaxCheckBox's model object to decide what to return.
Sorry, I'm kind of a beginner to GUI interfaces (well, a beginner to java, really), and I was wondering: How does one make a list of items that the user can add items to or remove items from, with the press of a + or - button?
What I really want (sorry if I'm being a little vague here) is one of those lists you sometimes see in application windows, which looks like a text box but cannot be typed in. Right now my application (it's a small app to organize the schedule of a hospital) just reads from a text file and writes to another text file. No GUI, no window, the user just writes a bunch of names in the text file, one per line, then runs the jar and opens the output file and the schedule is there. I want them to just be able to add or remove names from a list with buttons — adding a name by clicking 'plus' and typing the name, and removing a name by selecting the name and clicking 'minus'. I still, however, want it to save to a text file, so that the next time the user opens the app, all the names are still on the list.
Just to be clear, I don't want a list displaying the output (i.e. the names organized into a schedule), just one containing the input.
Thanks a lot for any help you can give.
You probably want a JList with a couple of JButton instances to add/remove items.
See:
How to Use Lists
How to Use Buttons, Check Boxes, and Radio Buttons
I am trying to implement a text box that, when the user types something, it asynchronously expands a drop-down menu that contains suggestions, much like how the Google search bar shows predictive search queries. In other words, combining an EditText with a Spinner in the sense that the user types something and it presents a list of selectable options right below it. Does such a class exist in the Android library?
You can follow this tutorial from android:
http://developer.android.com/resources/tutorials/views/hello-autocomplete.html
is an auto complete example on a EditText.