Android Question Really newbie question - Dialogs

kepler

Active Member
Licensed User
Longtime User
Good morning,

In the attempt to verify my routines, I'm trying to build a simple dialog that inputs a number(double or decimal).

So I made this simple code:

Dim temp
Dim Id As InputDialog
Id.InputType = Id.INPUT_TYPE_DECIMAL_NUMBERS
temp = Id.Input

expecting that temp would give something... Oh, it gives me something: java.lang.NumberFormatException...

I can't find a simple example in the forums - sorry...

Kind regards,

Kepler
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

Thanks for the tip DonManfred ;)

I've managed to get what I wanted with this code:

B4X:
Sub Globals
Dim btnTest As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim temp,answer
Dim Id As InputDialog
Id.InputType = Id.INPUT_TYPE_DECIMAL_NUMBERS
btnTest.Initialize("Click")
Id.Input = btnTest.Text
answer = Id.Show("Button Name eingeben", "EINGABE", "Yes", "", "No", Null)
If answer = DialogResponse.POSITIVE Then
btnTest.Text = Id.Input
End If

temp = btnTest.Text
...


Where temp has the input value.

Kind regards,

Kepler
 
Last edited:
Upvote 0
Top