我使用MatrixCursor在我的地图搜索数据库内容中使用搜索。我有一个Android SDK版本为2.2的NumberFormatException。在我的声明中,我做到了:
private static final String[] COLUMNS = {
_ID, // must include this column
SearchManager.SUGGEST_COLUMN_TEXT_1,
SearchManager.SUGGEST_COLUMN_INTENT_DATA };我还为MatrixCursor创建了一个对象,该对象具有:
MatrixCursor cursor = new MatrixCursor(COLUMNS);
cursor.addRow(columnValuesOfQuery(query, s));下面是我得到的异常:
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): error changing cursor and caching columns
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): java.lang.NumberFormatException:
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): at java.lang.Long.parseLong(Long.java:347)
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): at java.lang.Long.parseLong(Long.java:320)
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): at android.database.MatrixCursor.getLong(MatrixCursor.java:255)
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)为什么我会得到这个异常,我如何修复它?
发布于 2010-10-23 02:11:22
好的,听起来类似于在SDK 8的模拟器上使用地理编码器时检索到的异常。我猜这是另一个与地理编码器类相关的模拟器错误,在真实的设备上尝试这个,或者降低模拟器上的SDK版本-应该可以做到这一点。
https://stackoverflow.com/questions/3999544
复制相似问题