我在我的Android应用程序中收到此错误。当我想要自动建议时,我收到了这个错误。为什么我收到此错误。请帮助我。
FATAL EXCEPTION: main
java.lang.NumberFormatException: Invalid long: "name"
at java.lang.Long.invalidLong(Long.java:125)
at java.lang.Long.parse(Long.java:362)
at java.lang.Long.parseLong(Long.java:353)
at java.lang.Long.parseLong(Long.java:319)
at android.database.MatrixCursor.getLong(MatrixCursor.java:255)
at android.widget.CursorAdapter.getItemId(CursorAdapter.java:220)
at android.widget.AutoCompleteTextView.buildImeCompletions(AutoCompleteTextView.java:1123)
at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1082)
at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:971)
at android.widget.AutoCompleteTextView.access$800(AutoCompleteTextView.java:91)
at android.widget.AutoCompleteTextView$PopupDataSetObserver$1.run(AutoCompleteTextView.java:1268)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:0)
这会崩溃,因为它不是long
Long.parseLong("name")
必须是这样的
Long.parseLong("12345567890")