hello
I have a little problem with a Routine. I want to move into a class.
somehow the problem is also clear to me, but I don't know how to solve it.
I have the function
Show_InputBox' in the activity everything works without problems.
If I move it into a class module I get the following error message:
'An Activity Context is required.
This Class has no process Content
Additing a global Activity object variable will fix this issue.'
regards Frank
I have a little problem with a Routine. I want to move into a class.
somehow the problem is also clear to me, but I don't know how to solve it.
I have the function
Show_InputBox' in the activity everything works without problems.
If I move it into a class module I get the following error message:
'An Activity Context is required.
This Class has no process Content
Additing a global Activity object variable will fix this issue.'
regards Frank
B4X:
Wait For(Show_InputBox("Keywort eingeben","", "ok","cancel","")) Complete (ergebnis As String)
public Sub Show_InputBox(title As String, default As String, ok As String, cancel As String, neg As String) As ResumableSub
Dim dlg As CustomLayoutDialog
Private Eingabefeld As EditText
Dim sf As Object = dlg.ShowAsync(title, ok, cancel, neg, Null, False)
dlg.SetSize(100%x, 250dip)
Wait For (sf) Dialog_Ready (DialogPanel As Panel)
Eingabefeld.Initialize("")
Eingabefeld.Hint = default
DialogPanel.AddView(Eingabefeld,5%x,30dip,80%x,50dip)
Wait For (sf) Dialog_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
Return Eingabefeld.Text.trim
Else
Return ""
End If
End Sub