Android Question java.lang.NumberFormatException

hookshy

Well-Known Member
Licensed User
I can not find what the problem is ...can you help ?

B4X:
Azi, 18:32 în versiunea 108 a aplicației
Samsung Galaxy J7 Pro (j7y17lte), Android 7.0
Raportul 1 din 1
java.lang.NumberFormatException:
  at java.lang.FloatingDecimal.readJavaFormatString (FloatingDecimal.java:1071)
  at java.lang.Double.parseDouble (Double.java:547)
  at com.cote.montaj.main._btn_automatic_click (main.java:3834)
  at java.lang.reflect.Method.invoke (Native Method)
  at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:191)
  at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:175)
  at anywheresoftware.b4a.BA.raiseEvent (BA.java:171)
  at anywheresoftware.b4a.objects.ViewWrapper$1.onClick (ViewWrapper.java:80)
  at android.view.View.performClick (View.java:6261)
  at android.widget.TextView.performClick (TextView.java:11159)
  at android.view.View$PerformClick.run (View.java:23752)
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6776)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1386)



B4X:
Sub btn_automatic_Click
    
    ToastMessageShow("Working on this feature",True)
    Dim BD As BetterDialogs
    Dim dia As Int
    
    
    Dim IP As BD_InputBoxParams
    IP.Initialize
    IP.Question = tr.get("Enter value 0 to disable this function")
    IP.QuestionTextSize = 18
    IP.SpaceBetween = 4dip
    IP.InputTextSize = 24
    IP.InputType = IP.INPUT_TYPE_DECIMAL_NUMBERS
    IP.Gravity = Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL
    IP.ValidationCallback = "Input_Validation"
    IP.WithSuggestions = True
            

    dia = BD.InputBox(tr.get("Enter ortho snap value from 1 to 30: "), IP, "OK", "",tr.get("SKIP"), Null)
    Log("DR=" & dr)
    
    
    If dia = DialogResponse.POSITIVE  Then
        Log(IP.Answer)
                
            
                
        automatic=IP.Answer
        File.WriteString(File.DirInternal,"automatic.txt",automatic)
        ToastMessageShow("Ortho snap: "&automatic,True)
            
    
                
                
                
    End If
    
End Sub
 

JordiCP

Well-Known Member
Licensed User
You are probably assigning an empty string to a Float somewhere
What are the types of "automatic" and "IP.Answer", and which is its value when it crashes?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
You are probably assigning an empty string to a Float somewhere
What are the types of "automatic" and "IP.Answer", and which is its value when it crashes?
automatic is int variable
the imput is forced to decimal number
in my device everthing works even if i enter numbers like 122.4
it seems that the errorr does not repeat ..so how knows
 
Upvote 0
Top