Android Question Modal Forms like windows modal forms

Eduardo Funabashi

Member
Licensed User
Hello,
In my program I need to execute others activities / layouts to the user select some items and then continue the program.
See example:
code ......
code .......
' here I need to show to the user another layout to select an item
If REG_PEGA_PREPARO = 1 Then
StartActivity("Pega_Preparo") ' layout to the user select an item
End If

code ......
code .......

' here I need to show the user another layout to select another item
If REG_PEGA_PESO = 1 Then
StartActivity("Pega_Peso") ' layout to the user select another item
End If

code ......
code .......
' then with de data selected by the user, program continues...

My problem is that when I execute StartActivity("Pega_Preparo"), code continues till end of the Sub.
But I need code to wait for StartActivity("Pega_Preparo") be closed to program continues.

How to do this job ?

Regards
 

Devan

Member
Licensed User
I think you should start new activity module than once user input back to main activity. Im still new to programming. Try to do more research or ask Erel. He knows better.
Take care
 

klaus

Expert
Licensed User
As NJDude already said, you need to switch from top down programing to event driven programing.
Depending on what data the user must enter the principle might be different.
You should explain more in detail your problem to get concrete advices.
 

MarkusR

Well-Known Member
Licensed User
Hi, I would like to ask how to make a floating form same the attached picture. which the previous form is visible, it's like a modal form in windows applications.
Joey
one possibility
B4X:
    Dim options As List = Array("Red", "Green", "Blue")
    InputListAsync(options, "Select Color", 0, False)
    Wait For InputList_Result (Index As Int)
    If Index <> DialogResponse.CANCEL Then
        Log("Selected color: " & options.Get(Index))
    End If
 
Top