This is part of the code, and the question is, how can I INTENT this values
Log.i(TAG, "Display Name: " + person.getDisplayName());
Log.i(TAG, "Gender: " + person.getGender());
Log.i(TAG, "About Me: " + person.getAboutMe());
Log.i(TAG, "Birthday: " + person.getBirthday());
Log.i(TAG, "Current Location: " + person.getCurrentLocation());
Log.i(TAG, "Language: " + person.getLanguage());
To another activity.
My idea which do not work is to do it like this
userGenderG = person.getGender();
userAboutG = person.getAboutMe();
userBirthdayG = person.getBirthday();
userLanguageG = person.getLanguage();
Unsuccessful idea.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
// G+
if (mGoogleApiClient.hasConnectedApi(Plus.API)) {
Person person = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
if (person != null) {
Log.i(TAG, "--------------------------------");
Log.i(TAG, "Display Name: " + person.getDisplayName());
Log.i(TAG, "Gender: " + person.getGender());
Log.i(TAG, "About Me: " + person.getAboutMe());
Log.i(TAG, "Birthday: " + person.getBirthday());
Log.i(TAG, "Current Location: " + person.getCurrentLocation());
Log.i(TAG, "Language: " + person.getLanguage());
userGenderG = person.getGender();
userAboutG = person.getAboutMe();
userBirthdayG = person.getBirthday();
userLanguageG = person.getLanguage();
} else {
Log.e(TAG, "Error!");
}
} else {
Log.e(TAG, "Google+ not connected");
}
}
}
Any suggestion about how could I user gender as value and intent them to another activity?
UPDATED (how send data)
GoToNewActivity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, Index.class);
Bundle extras = new Bundle();
extras.putString("userGender", userGenderG);
extras.putString("userAbout", userAboutG);
extras.putString("userBirthday", userBirthdayG);
extras.putString("userLanguage", userLanguageG);
intent.putExtras(extras);
startActivity(intent);
}
});