Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a text filter (like quick search) for a Spinner in Android

I'm developing an Android application. I have my activity here with some widgets including a Spinner. I want that Spinner object to be searchable using the quick search button. The idea is that the user tapped the Spinner object and he sees the list (the adapter). If he taps the quick search button he should be provided with a text field to enter a letter and then the spinner list jumps to the fist word it finds with the letter supplied. Just as it works with html and select tags.

I tried google (and SO of course) but it seems that

  • no one is interested in a solution like this or
  • it is a closely guarded secret. :)

Do you have some pointers in this topic?

like image 425
Adam Arold Avatar asked Apr 27 '11 09:04

Adam Arold


People also ask

How can I make my spinner look like Edittext?

Here is an workaround: Spinner spinner = (Spinner) findViewById(R. id. spinner); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, R.

How can I get spinner in Android?

This example demonstrates how do I get spinner value in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

How do you create a drop down list on Android?

You can add a dropdown menu to your Android application in a few simple steps. For starters, you need to edit the XML files. Integrate the dropdown menu into them using Android Studio's drag-and-drop feature. Next, you have to create a string array to add all the relevant items to your dropdown menu.

What is custom spinner in Android?

In Android, Spinners provides you a quick way to select one value from a set of values. Android spinners are nothing but the drop-downlist seen in other programming languages. In a default state, a spinner shows its currently selected value. It provides a easy way to select a value from a list of values.


1 Answers

Looks like you are talking about similar functionality given in AutoCompleteTextView

like image 127
Rajath Avatar answered Sep 19 '22 04:09

Rajath