Facebook Profile Picture View not refreshing on successful login/logout in Android -
seeing strange behavior
private void profilechanged(profile oldprofile, profile currentprofile){ profilepictureview profilepictureview = (profilepictureview) findviewbyid(r.id.selection_profile_pic); textview usernameview = (textview) findviewbyid(r.id.user_name); if (currentprofile != null) { navigationview navigationview = (navigationview) findviewbyid(r.id.nav_view); menu menu = navigationview.getmenu(); menuitem nav_signout = menu.finditem(r.id.signout); nav_signout.settitle(r.string.signout); profilepictureview.setprofileid(currentprofile.getid()); usernameview.settext(string.format("%s %s",currentprofile.getfirstname(), currentprofile.getlastname())); } else { navigationview navigationview = (navigationview) findviewbyid(r.id.nav_view); menu menu = navigationview.getmenu(); menuitem nav_signout = menu.finditem(r.id.signout); nav_signout.settitle(r.string.signin); profilepictureview.setprofileid(null); usernameview.settext(r.string.welcome); } }
above function calling from
protected void oncurrentprofilechanged(profile oldprofile, profile currentprofile)
i want toggle text on signin/out button. above code, profilepictureview not show image of logged in user. infact doesnt change @ all.
as comment out code toggling text, profilepictureview starts working expected.
any idea why changing text of menuitem interfere loading of picture?
thanks chahat
Comments
Post a Comment