What is this component in Android? - android

I tried to reproduce this component in my app :
Is it an expandableListView ?
Because I tried to use expandablelistview and I get this result :

Its called spinner and Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value.
refer this link http://developer.android.com/guide/topics/ui/controls/spinner.html

Related

Name of this Android UI component (img)

I would ask what is name of this UI component:
I need a make something like this in my app., so I will very happy if you answer me :)
It is called as Spinners in android.... here is a link for a tutorial that will help u creating one.
Tutorial Link
You can find the official documentation here
This is a Spinner.
Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one.
(cf documentation)

Can we give hint to a spinner whose data is coming programmatically from the database?

I am working on a spinner in which I am getting values of the spinner from the database.
I want to add hint to this spinner...and the problem arising is that I cannot able to add hint to this spinner.
What should I do?...
You have to create a costum adapter for your spinner. There are some tutorials on the web:
Android: Spinner hint
I think you are trying to make an initial text in spinner. You can do it in many ways
How to make an Android Spinner with initial text “Select One”
Otherwise you can use a button instead of spinner and create a dialog when button clicked
I have developed a little component to get this. Just add a hint text in AutoCompleteTexview and build CompleteSpinner with it
https://github.com/FernandoGaliay/CompleteSpinner

Android Spinners with different Display text from the list values

I'm playing around with Android spinners. I'm not 100% sure if I can get the behavior I want using a spinner, but it's the most obvious choice that comes to mind.
I need something of a dropdown view, the title of which says "x of y selected".
The options in the dropdown would look like:
-All
-None
-Special items only
On clicking one of the dropdown items, the title is reconfigured such that 'x' changes.
It would be ideal to use a spinner, but somehow, it seems that android puts in the first value of the spinner to always be the first values in the list of strings you pass it, and I clearly don't want the title item to be shown in the dropdown list for my case.
Another approach that I came across was to perhaps use a button with a popup with these items in the popup.
Would that be a better approach, or can I actually achieve the behavior using a spinner, or is there another view that would better serve my purpose?
I'm going to redirect to this post, after a lot of searching I found what I was looking for:
How to hide one item in an Android Spinner
The answer by Aebsubis, and make sure to set the text view height to 0. I'll update this answer with more code, once I'm done with tweaking it for my purposes.

something like dropdown in a android app?

I'm searching for a widget in a android app where the user can select a item from a specific list. it's only possible to select one and the list is defined by the app.
it's like a dropdown. I can't use a simple listView because I need at least 4 of there controls on one page. so what is a good solution?
I think, you are looking for something like Spinners
Spinners is what you are looking for.
You can use Spinner in android for dropdown.or you can use AlertDialog as like that of drodown.For using spinner read this.For using AlertDialog read this

What is the difference between text field types

I am new to android. I was stuck on a problem but I finally solved it.
I was using a TextField instead of CompleteTextViewField so whats the difference between these two and when should I use each one of them?
Thanks
Neither of those classes you mention (TextField, CompleteTextViewField) exist. Do you mean EditText and AutoCompleteTextView? I think the documentation explains it pretty well:
[AutoCompleteTextView is] 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.
That is, use it rather than a normal EditText if you have a set of common autocompletions for what gets entered in the box. The docs also link to a full sample that shows how to populate that list of suggestions with an Adapter.

Categories

Resources