tags:

views:

37

answers:

2

Friend's I implemented AutoCompleteTextView for searching whether it supports in all SDK Version and target,because i tried the sample from http://developer.android.com/resources/tutorials/views/hello-autocomplete.html it nothing shows in dropdownlist, when i used im application for parsed content kept in an string array,i'm getting Exception,what is wrong with

Here my code

Log.v("Length of a",Integer.toString(a.length));
                    try{
                    wv.setVisibility(View.GONE);
                    place_list.setVisibility(View.VISIBLE);
                    Log.v("Length of a222222",Integer.toString(a.length));
                    ArrayAdapter<String> adapter = new ArrayAdapter<String>(Bru_Maps.this, android.R.layout.simple_dropdown_item_1line, a);
                    textView.setAdapter(adapter);
                    }catch(Exception e)
                    {

                        Log.v("Error","search_name"+e);

                    }

from the above code prints the log has well but it return null pointer exception

ArrayAdapter<String> adapter = new ArrayAdapter<String>(Bru_Maps.this, android.R.layout.simple_dropdown_item_1line, a);

here the a is string variable contains the parsed data to bind in list. help me.

Thanks in advance.

A: 

Can't add comments yet, so... What is the datatype for a? You wrote that it is a string when it needs to be an array of strings.

Eli
+1  A: 

As I can see from the example, you need to set the Threshold value to 1, if you want to see the list of available countries after you type the first character in the TextView. Use autoCompleteTextView.setThreshold(1) to see it in action.

Ragunath Jawahar
thanks dude..i got it
MGS