Hi there,
I had to develop some own dialog logic, because of some limitations in the dialog lib. For instance I have to create another look and feel.
So in my attempt, I created a code modul for some handling and starting activities. By calling the code moduls method, a dialog activity will be called. After finishing this activity the main activity will resume and I catch the values in Activity_resume and I go further. All worked fine!
But now I have a additonal scenario. And I have to call the same "dialog activity" by catching the values in Activity_resume. The problem now is that the code modul will be fired correctly but from there it goes no further to a new adialog. You could possibly understand it better with a little code.
I will note, that calling another activity instead of EditNoteToNothing(True) [same activity] will be handled correcty.
Silentsea
I had to develop some own dialog logic, because of some limitations in the dialog lib. For instance I have to create another look and feel.
So in my attempt, I created a code modul for some handling and starting activities. By calling the code moduls method, a dialog activity will be called. After finishing this activity the main activity will resume and I catch the values in Activity_resume and I go further. All worked fine!
But now I have a additonal scenario. And I have to call the same "dialog activity" by catching the values in Activity_resume. The problem now is that the code modul will be fired correctly but from there it goes no further to a new adialog. You could possibly understand it better with a little code.
B4X:
Sub Activity_Resume
Select Case(cDialog.CallId)
...
Case "EditNote"
EditNote(False)
Case "EditNoteToNothing"
EditNoteToNothing(False)
End Select
If cDialog.CallId <> "" Then
...
End If
End Sub
Sub EditNote(CallDialog As Boolean)
If CallDialog Then
cDialog.Show("EditNote", "Notiz bearbeiten", "Notiz:", cDialog.DialogType_Input, cDialog.DialogOptions_SaveCancel)
cDialog.txtValueToStartWith = cPictureNote.GetNote(ActiveNoteId)
cDialog.txtHint = "Notiz bearbeiten"
Else
If cDialog.DialogResult = cDialog.DialogResult_Save Then
If cDialog.txtValue <> "" Then
cPictureNote.SaveNote(ActivePictureId, ActiveNoteId, cDialog.txtValue)
'refresh notes scrollview
BuildScrollViewNotes(ActiveNoteId)
Else
'we cannot edit a note to nothing, so we have to note this to customer, maybe he wants to delete
EditNoteToNothing(True)
'StartActivity(aDialog)
End If
End If
End If
End Sub
Sub EditNoteToNothing(CallDialog As Boolean)
If CallDialog Then
cDialog.Show("EditNoteToNothing", "Warnhinweis", "Sie können diese Notiz nicht ohne Wert speichern, wollen Sie die Notiz löschen?", cDialog.DialogType_Warning, cDialog.DialogOptions_YesNo)
Else
If cDialog.DialogResult = cDialog.DialogResult_Yes Then DeleteNote
End If
End Sub
'in code module:
Sub Show(CallId_ As String, Header_ As String, Content_ As String, DialogType_ As DialogType, DialogOptions_ As DialogOptions)
...
Try
StartActivity(aDialog)
Catch
cTools.Debug("##Exception## " & LastException)
End Try
End Sub
I will note, that calling another activity instead of EditNoteToNothing(True) [same activity] will be handled correcty.
Silentsea
Last edited: