android - Bundle in onConnect method of ConnectionCallback always returned null after connected to Google+ Account -


i followed integrating google+ android app

but have issue bundle null when returned me.

i dont know how get information related google+ account if bundle returned null.

so how bundle not return null.

please me,

thanks,

update know how information related account using following code :

    @override public void onconnected() {   ...   if (plus.peopleapi.getcurrentperson(mgoogleapiclient) != null) {     person currentperson = plus.peopleapi.getcurrentperson(mgoogleapiclient);     string personname = currentperson.getdisplayname();     string persongoogleplusprofile = currentperson.geturl();   } } 

anyway, dont know bundle returned doing what's thing?

p/s : codes :

java code :

@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);  setcontentview(r.layout.fragment_create_account);  /**  * initial google plus authentication  */ mgap = new googleapiclient.builder(this)         .addconnectioncallbacks(this)         .addonconnectionfailedlistener(this)         .addapi(plus.api)         .addscope(plus.scope_plus_profile)         .build(); 

}

@override public void onconnected(bundle bundle) {     // todo bundle return null     log.i("", "onconnected " + bundle);     if (bundle != null)         log.i("", "bundle " + bundle.size() + " " + bundle.tostring()); }  @override public void onconnectionfailed(connectionresult connectionresult) {     log.i("", "onconnectionfailed ");     if (!mintentinprogress && connectionresult.hasresolution()) {         try {             mintentinprogress = true;             startintentsenderforresult(connectionresult.getresolution().getintentsender(),                                                      0, null, 0, 0, 0);         } catch (intentsender.sendintentexception e) {             // intent canceled before sent.  return default             // state , attempt connect updated connectionresult.             mintentinprogress = false;             mgap.connect();         }     } }  @override public void onconnectionsuspended(int i) {     log.i("", "onconnectionsuspended " + i); } 

manifest.xml file :

<meta-data android:name="com.google.android.gms.version"                android:value="@integer/google_play_services_version" />      <uses-permission android:name="android.permission.get_accounts" />     <uses-permission android:name="android.permission.interact_across_users_full" />     <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.use_credentials" /> 

build.grade file :

compile 'com.google.android.gms:play-services:5.0.89' 

this documentation says "note contents of connectionhint bundle defined specific services...and may null if no content provided service". don't use bundle.

once connected, can other information (like people in user's circles) outlined here.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -