Android Question Read registration_id from Main Module

Peter Yeung

Member
Licensed User
Longtime User
Is it possible to read value of Intent.GetExtra("registration_id") in HandleRegistrationResult Function in PushService Module from the Main Module. I want to import the token to mysql.

I tired to declare a public variable in Main Module, and then change the value in HandleRegistrationResult but it failed:

- In Main:
Sub Process_Globals
Public sToken As String
End Sub

- In PushService:
Sub HandleRegistrationResult(Intent As Intent)
If Intent.HasExtra("error") Then
Log("Error: " & Intent.GetExtra("error"))
ToastMessageShow("Error: " & Intent.GetExtra("error"), True)
Else If Intent.HasExtra("registration_id") Then
Dim token As String = Intent.GetExtra("registration_id")
'Dim j As HttpJob
Main.sToken = token
End If
End Sub

But the value of sToken is still null in Activity_Create.

Please help!
 
Top