-2
.lang.RuntimeException: Unable to start activity ComponentInfo{com.ADHD.AiKO/com.ADHD.AiKO.StudyAnalyzer.ResultView.popupWndowAcitivity}: java.lang.NumberFormatException: For input string: ""
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2944)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3079)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1836)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6702)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
     Caused by: java.lang.NumberFormatException: For input string: ""
        at java.lang.Integer.parseInt(Integer.java:627)
        at java.lang.Integer.parseInt(Integer.java:650)
        at com.ADHD.AiKO.StudyAnalyzer.ResultView.popupWndowAcitivity.onCreate(popupWndowAcitivity.java:157)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2924)

This is my error line,

final int plChildren = Integer.parseInt(plOtherChildren);

So why this error like this?

Jaysmito Mukherjee
  • 1,467
  • 2
  • 10
  • 29
Achintha
  • 1
  • 2

1 Answers1

0

This error is occurrs when you try to parse en empty string or in this case if your string has anything but a number it will throw this error. For example -

String mString = "23he"
Int num = Integer.parse(mString)

The code above will give the same error and if the mString is empty the same will happen so make sure your string is not empty and only an integer is present in the string.