1

I am trying to create a custom auto complete text view that contains a progress bar (circle in my case).My problem is that every time the user inputs a char a web service is accessed and there is some delay until a display some results.I would like to place a progress circle that will suggest to the user that there is some work in progress.As an excelent example of what i would want you could take a look at googles maps address auto complete.

Thanks for any suggestions.

mvlupan
  • 3,536
  • 3
  • 22
  • 35

3 Answers3

0

Use the below code for the implementation

   <FrameLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <AutoCompleteTextView
        android:id="@+id/lkjk"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:completionThreshold="3"
        android:dropDownHeight="200dp"
        android:ems="10"
        >

        <requestFocus />
    </AutoCompleteTextView>

    <ProgressBar
        android:id="@+id/progress_bar"
        android:layout_width="25dip"
        android:layout_height="25dip"
        android:layout_gravity="right" />
</FrameLayout>
Deepak Goel
  • 5,624
  • 6
  • 39
  • 53
0

I think an AutoCompleteTextView is something what you are looking for.

Also, link to a tutorial.

Edit: For the progress bar part, I would have had a infinite progress bar on the title bar of my application. I feel that would be a more complete solution as I can re-use it for any other task also. Something similar is discussed here.

Community
  • 1
  • 1
Anand Sainath
  • 1,807
  • 3
  • 22
  • 48
  • Hi.Thanks for your answer.I have already specified that i know that this should be AutoCompleteTextView.i have already written the code for it.The only thing i am missing is a progress bar (circle) that is displayed while i am searching for results using webservices.Also i would like this progress bar to be incorporated in the autocomplete text view. – mvlupan Feb 18 '12 at 09:58
-1

Follow http://developer.android.com/resources/tutorials/views/hello-autocomplete.html think and user Progress bar and u need to Use Handler in this case

Ronak Mehta
  • 5,971
  • 5
  • 42
  • 69