android - What to do after using UserSettingsFragment to login -
so able login , logout using usersettingsfragment, cannot seem additional functionality work after logging in. replace usersettingsfragment fragment of own after successful login , current code doesn't work this:
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { usersettingsfragment.onactivityresult(requestcode, resultcode, data); super.onactivityresult(requestcode, resultcode, data); uihelper.onactivityresult(requestcode, resultcode, data); facebookhelperfragment fbhf = new facebookhelperfragment(); fragmentmanager fm = getsupportfragmentmanager(); fm.begintransaction().replace(r.id.fb_helper_frag, fbhf) .addtobackstack(null).commit(); }
when run it, looks fbhf flashes on screen momentarily, goes displaying default login screen usersettingsfragment shows logged in user's name , image logout button. also, don't want utilize deprecated code. using usersettingsfragment, haven't seen much usage of other logout only, or part of sessionloginsample.
thanks
the reply came me in sleep.
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { usersettingsfragment.onactivityresult(requestcode, resultcode, data); super.onactivityresult(requestcode, resultcode, data); uihelper.onactivityresult(requestcode, resultcode, data); if (resultcode == -1) { facebookhelperfragment fbhf = new facebookhelperfragment(); fragmentmanager fm = getsupportfragmentmanager(); fm.begintransaction().hide(usersettingsfragment) .add(r.id.fb_helper_frag, fbhf).addtobackstack(null) .commit(); } }
just needed hide static usersettingsfragment before dynamically adding facebookhelperfragment.
android facebook facebook-login
No comments:
Post a Comment