开发者

Map Search NumberFormat Exception in android platform 2.2

开发者 https://www.devze.com 2023-01-21 16:45 出处:网络
Friend\'s I implemented map with search option in my application,when i run the application in HTC,SonyEricson it\'s working well,but when i make the search in Motorola Droid 2.2,i\'m getting numberfo

Friend's I implemented map with search option in my application,when i run the application in HTC,SonyEricson it's working well,but when i make the search in Motorola Droid 2.2,i'm getting numberformat exception, here my code for search option

findViewById(R.id.map_search).setOnClickListener(
     new OnClickListener() {
      public void onClick(View v) {
       try{
       onSearchRequested();
       }
       catch(Exception e)
       {
        Log.v("Error",""+e);

       }
      }
     });

Here i fetching the data from database to search list data to user. Here my code for database side

@Override
 public Cursor query(Uri uri, String[] projection, String selection,
   String[] selectionArgs, String orderBy) {

if (uriMatcher.match(uri) == BRUMAPS_ID) {
   long id = Long.parseLong(uri.getP开发者_如何学JAVAathSegments().get(1));
   selection = appendRowId(selection, id);
  }
if (uriMatcher.match(uri) == BRUMAPS) {
   db = news.getReadableDatabase();
   cursor = db.query(TABLE_NAME2, projection, selection,
     selectionArgs, null, null, orderBy);

  }

}

below the exception i'm getting in Moto-Droid 2.2 even in Droid 2.1 is working good

10-22 14:14:20.832: DEBUG/ThrottleService(60): onPollAlarm - roaming =false, read =0, written =0, new total =0
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)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SuggestionsAdapter.notifyDataSetChanged(SuggestionsAdapter.java:193)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:260)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SuggestionsAdapter.changeCursor(SuggestionsAdapter.java:238)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorFilter.publishResults(CursorFilter.java:67)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.os.Looper.loop(Looper.java:123)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.reflect.Method.invoke(Method.java:521)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at dalvik.system.NativeStart.main(Native Method)
10-22 14:14:21.493: DEBUG/AndroidRuntime(319): Shutting down VM
10-22 14:14:21.493: WARN/dalvikvm(319): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-22 14:14:21.522: ERROR/AndroidRuntime(319): FATAL EXCEPTION: main
10-22 14:14:21.522: ERROR/AndroidRuntime(319): java.lang.NumberFormatException: 
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.Long.parseLong(Long.java:347)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.Long.parseLong(Long.java:320)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.os.Looper.loop(Looper.java:123)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.reflect.Method.invoke(Method.java:521)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at dalvik.system.NativeStart.main(Native Method)
10-22 14:14:21.563: WARN/ActivityManager(60):   Force finishing activity com.example.brown/.Bru_Maps
10-22 14:14:22.172: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{44eed238 com.example.brown/.Bru_Maps}
10-22 14:14:23.671: WARN/InputConnectionWrapper.ICC(108): Timed out waiting on IInputContextCallback
10-22 14:14:25.813: WARN/InputConnectionWrapper.ICC(108): Timed out waiting on IInputContextCallback
10-22 14:14:26.451: DEBUG/dalvikvm(108): GC_EXTERNAL_ALLOC freed 2450 objects / 141280 bytes in 320ms

what reason for getting this problem in Droid2.2 alone,but it works ion other devices.how can i fix this problem.

Thanks in advance

0

精彩评论

暂无评论...
验证码 换一张
取 消