tags:

views:

27

answers:

1

Friend's I have list of places in my database,when i click search option from my UI i have to fetch the data from database and the listed below the textbox,and then i select the corresponding place to search on google maps,it works fine for android platform below 2.1,but when i use 2.2 i'm getting force close Exception.Is there any other way to implement search option in android.

here the exception i'm getting in 2.2 platform 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): error changing cursor and caching columns 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): java.lang.NumberFormatException: 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at java.lang.Long.parseLong(Long.java:347) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at java.lang.Long.parseLong(Long.java:320) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.database.MatrixCursor.getLong(MatrixCursor.java:255) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.database.CursorWrapper.getLong(CursorWrapper.java:127) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002) 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): at android.app.SearchDialog.onDataSetChanged(SearchDialog.java:612)

Thanks in advance.

+1  A: 

If you're using the Geocoder .getFromLocationName method there seems to be problem in the emulator with API level 8 (SDK 2.2) target in Eclipse. see link text

If you switch your target to API level 7, it may work properly for you.

Whoops! you edited whilst I was composing this, my suggestion might not work

NickT
Correct i had the same issue and believe its a bug in the emulator should work fine on device - for testing use api levl 7 if you can (or a real phone)
Jason
I'm checked upon both device and emulator,still it's not fixed,i'm using map api 1.6 version,whether i have to use higher version map api or else what i do.I'm using the below permission <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" android:maxSdkVersion="8" />,whether i need to change anyting from manifest or i have to higher version map api
MGS