Java.Lang.NumberFormatExeption

thestar19

Member
Licensed User
Longtime User
Hey guys

So,I get this wierd java error every time that I try to start my app
The text is:
An error has occurred in sub:
Main_activity_create(java line:267)
Java.Lang.NumberFormatExeption
Continue?


B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
If FirstTime = True Then
Map1.Put("number_correct",corrects)
Map1.Put("number_wrong",wrong)
Map1.Put("number_times",times)
End If
corrects = corrects+Map1.Get("number_correct")
wrong = wrong+Map1.Get("number_wrong")
Msgbox(Map1.Get("number_wrong"),"Info")
End Sub

A bit down in the code I have
B4X:
Map1.Put("number_correct",corrects)
Map1.Put("number_wrong",wrong)
Map1.Put("number_times",times)

Yes I have a layout called main
However,When I remove the map1 code,The projekt runs fine,What am I doing wrong?

Please help me :)

The application should save the data and open it later
corrects,wrong and times are all int numbers.

Thestar19
 

thestar19

Member
Licensed User
Longtime User
Yes,But when I moved the Map1.Initialize from "sub globals",then the java error changed from 267 to 269,Does it make a diffrence?
Edit:
It is now under "Sub Activity_Create(FirstTime As Boolean)" instead
 
Last edited:
Upvote 0

thestar19

Member
Licensed User
Longtime User
Thank you
I tested the app with my Android phone and there it was no problem,Thank you anyway,The problem is only limited to the emulator :)

Edit
Apperently not,I do get an null error this time however :)
 
Last edited:
Upvote 0

thestar19

Member
Licensed User
Longtime User
Okay,SO I have some new info

The problem in the code is NOT the get data,The problem is:
B4X:
wrong = wrong+Map1.Get("number_wrong")
corrects = corrects+Map1.Get("number_correct")
times = times+Map1.Get("number_times")
 
Upvote 0
Top