I am using intent to pass my data from one activity(auth page) to another activity to have access to the Facebook loggedIn user. I am not seeing any error in my code but the text to display the username returns empty(blank). What is missing in here? I followed answers of sample issues on S.O to achieve this.
auth.cs
mProfileTracker = new MyProfileTracker();
mProfileTracker.mOnProfileChanged += FindFaceBookUserProfile;
mProfileTracker.StartTracking();
private void FindFaceBookUserProfile(object sender, OnProfileChangeEventArgs e)
{
LoggedInUserName.Text = position.FindProfile.Name;
LoggedInUserLastName.Text = position.FindProfile.Name;
MajorActivity));
intent.PutExtra(MajorActivity.EXTRA_NAME, LoggedInUserName.Text);
this.StartActivity(intent);
}
public void OnSuccess(Java.Lang.Object result)
{
LoginResult loginResult = result as LoginResult;
Console.WriteLine(loginResult.AccessToken.UserId);
GetId= loginResult.AccessToken.UserId;
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
mCallbackManager.OnActivityResult(requestCode, (int)resultCode, data );
}
MajorActivity
public const string EXTRA_NAME = "UserName";
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
string UserName = Intent.GetStringExtra(EXTRA_NAME);
}
var headerView = navigationView.GetHeaderView(0);
GetUserName= headerView.FindViewById<TextView>(Resource.Id.loginUser);
GetUserName.Text = UserName;