You must use 1 SocialApiActivity per Activity. And since you have more than 1 providers, you have to use only 1 set of events that will be called by all providers.
The set of the events that will be raised by all providers:
Check the socialapi\multiple\sample2 project
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ThisActivity As SocialApiActivity
End Sub
Sub Activity_Resume
'Bind all providers to the same SocialApiActivity at once
ThisActivity.InitializeAndBind(Array As SocialApiProvider (Facebook, GooglePlus), "Provider")
End Sub
The set of the events that will be raised by all providers:
B4X:
Sub Provider_Event (Provider As SocialApiProvider)
BtnConnectFacebook.Enabled = Not(Facebook.Connected)
BtnDisconnectFacebook.Enabled = Facebook.Connected
BtnConnectGooglePlus.Enabled = Not(GooglePlus.Connected)
BtnDisconnectGooglePlus.Enabled = GooglePlus.Connected
End Sub
Sub Provider_Connected (Provider As SocialApiProvider)
End Sub
Sub Provider_Disconnected (Provider As SocialApiProvider)
End Sub
Sub Provider_Failed (Provider As SocialApiProvider)
If Msgbox2("Provider '" & Provider.Type & "' failed to actualize your details."&CRLF&CRLF&"Retry?", Provider.Type & ": Error", "Yes", "No", "", Null) = DialogResponse.POSITIVE Then
Provider.Retry
End If
End Sub
Check the socialapi\multiple\sample2 project
Last edited: