Skip to content

Error when running app #1

Description

@cavb

Hey!
Nice tutorial!
Got this error when running the app

Caused by: java.lang.NumberFormatException: Invalid int: "null"

Im curious why "cursor.getString(0)" is returning null (line 90 at DBHandler.java).
Commenting this line makes the app runnable.

08-09 22:04:47.358 4399-4399/com.mobilesiri.sqliteexample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mobilesiri.sqliteexample, PID: 4399 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobilesiri.sqliteexample/com.mobilesiri.sqliteexample.MainActivity}: java.lang.NumberFormatException: Invalid int: "null" at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388) at android.app.ActivityThread.access$800(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5312) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) Caused by: java.lang.NumberFormatException: Invalid int: "null" at java.lang.Integer.invalidInt(Integer.java:138) at java.lang.Integer.parseInt(Integer.java:358) at java.lang.Integer.parseInt(Integer.java:334) at com.mobilesiri.sqliteexample.DBHandler.getAllShops(DBHandler.java:90) at com.mobilesiri.sqliteexample.MainActivity.onCreate(MainActivity.java:27) ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions