新浪微博
Failed to find provider info for com.sina.weibo.sdkProvider
错误发生在新浪分享这里。
消息分享1:
//这是新浪demo的代码。
SendMessageToWeiboRequest request = new SendMessageToWeiboRequest();
request.transaction = String.valueOf(System.currentTimeMillis());
request.message = weiboMessage;
mWeiboShareAPI.sendRequest(WBShareActivity.this, request);
消息分享2:
SendMultiMessageToWeiboRequest request = new SendMultiMessageToWeiboRequest();
// 用transaction唯一标识一个请求
request.transaction = String.valueOf(System.currentTimeMillis());
request.multiMessage = weiboMessage;
AuthInfo authInfo = new AuthInfo(this, Constants.APP_KEY, Constants.REDIRECT_URL, Constants.SCOPE);
Oauth2AccessToken accessToken = AccessTokenKeeper.readAccessToken(getApplicationContext());
String token = "";
if (accessToken != null) {
token = accessToken.getToken();
}
mWeiboShareAPI.sendRequest(WBShareActivity.this, request, authInfo, token, new WeiboAuthListener() {
@Override
public void onWeiboException( WeiboException arg0 ) {
}
@Override
public void onComplete( Bundle bundle ) {
// TODO Auto-generated method stub
Oauth2AccessToken newToken = Oauth2AccessToken.parseAccessToken(bundle);
AccessTokenKeeper.writeAccessToken(getApplicationContext(), newToken);
Toast.makeText(getApplicationContext(), "onAuthorizeComplete token = " + newToken.getToken(), Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
}
});
本来用的消息分享2是可以的没有报错,但是换到消息分享1就报错了,换回来就又好了,随便查了一下竟然说这是无解洞。。记录下(之前遇到的小坑)。