private static final ListFeed",params,HttpMethod.POST,callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
}
}
private boolean isSubsetOf(Collection
有时我得到这2个错误….
java.lang.UnsupportedOperationException: Session: an attempt was made
to request new permissions for a session that has a pending request.
或者某个时候……
java.lang.UnsupportedOperationException: Session: an attempt was made
to request new permissions for a session that is not currently open.
任何建议都会受到赞赏.
接下来,您应该在onSessionStateChange方法中处理SessionState更改.虽然你没有,只有在调用publishAddCardStory方法的地方是在onCreate中,我假设你得到错误的原因是这样的:
>您在onCreate中调用publish方法
>在发布方法中,您通过会话调用requestNewPermissions,因此您的活动将被销毁,并且会显示请求允许来自用户的新权限的对话框的facebook活动,并且会话进入待处理状态
>用户将通过对话框允许(或不允许)新权限
>您的活动再次创建,因此当Session仍处于暂挂状态时,您再次调用newPermissionsRequest,而onSessionStateChange尚未调用
试着看看Facebook Dev Tutorials:https://developers.facebook.com/docs/android/scrumptious/
如何处理SessionState更改. Facebook SDK还提供了一些可能有用的示例应用程序.祝好运! 原文链接:https://www.f2er.com/android/430873.html