Android Question Really newbie question - Dialogs

Discussion in 'Android Questions' started by kepler, Mar 16, 2015.

  1. kepler

    kepler Active Member Licensed 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
     
  2. DonManfred

    DonManfred Expert Licensed User

  3. kepler

    kepler Active Member Licensed User

    Hi,

    Thanks for the tip DonManfred ;)

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

    Code:
    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: Mar 16, 2015
    Erel and DonManfred like this.
  4. DonManfred

    DonManfred Expert Licensed User

    Please use code tags when posting code!

    [​IMG]

    [​IMG]

    [​IMG]
     
    lemonisdead likes this.
  5. kepler

    kepler Active Member Licensed User

    Sorry...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice