Is what you posted your entire Activity?
You also need to override onActivityResult, and pass the values to Session.getActiveSession().onActivityResult(…). Otherwise, the Session won’t know that the user has authorized your app, and that’s why you see the error (Session thinks that there’s still a pending auth request, which is why you can’t reauthorize for publish).