the app crash because the activity is not created, these are my methods:
Sub fm_MessageArrived (Message As RemoteMessage)
Try
Dim ComunicationID As Int = Message.GetData.Get("ComunicationID")
Dim m As String = Message.GetData.Get("body")
Dim t As String = Message.GetData.Get("title")
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.SetInfo(t, m, Main)
n.Notify(1)
CallSubDelayed2(Main, "OpenComunication2", ComunicationID)
Catch
Log(LastException)
#if DEBUG
Msgbox(Message, "Notifica")
#End If
End Try
End Sub
private Sub OpenComunication2(ComunicationID As Int)
Do While Not(ApplicationIsReady)
Sleep(1000)
Loop
Dim cm As ResumableSub = RefreshData
ProgressDialogShow2("Aggiorno...", False)
Wait For (cm) Complete (Result As Boolean)
ProgressDialogHide
If Result Then
Dim c As Comunication = CurrentUser.GetComunucation(ComunicationID)
OpenComunication(c)
Else
Msgbox("Errore di connessione, provare ad aggiornare i dati!","Attenzione")
End If
End Sub
with these rows:
Do While Not(ApplicationIsReady)
Sleep(1000)
Loop
the app don't crash but i dont think is the right method to do this no?
Thanks