After 2 years of pause, I'm trying to build more Android apps.
I've attached a zip of an partly made application, I've search around in here and found no answer on how to make the program do a new calculation of "moment" (see zip to clarify).
I want my application to refresh the value of "moment" when one of the buttons is pressed, only way for me to make a new calculation, is to repick in the spinner ...
you should move the calculation out of the click event and put it in a sub that can be used from several places.
B4X:
Sub Spinner1_ItemClick (Position As Int, Value As Object)
calc
End Sub
Sub calc
Select Spinner1.SelectedItem
Case "M5"
moment = (4.6*lubfaktor*gradefaktor)
EditText1.Text=NumberFormat(moment,0,1)
Case "M6"
moment = (7.8*lubfaktor*gradefaktor)
EditText1.Text=NumberFormat(moment,0,1)
End Select
End Sub