Android java.lang.NullPointerException:无身份验证头信息#467
我的目标是从gmail中获取好友联系人列表,我已经检查了此异常的帖子编号,但没有人被正确的解决方案评论。它已成为我的拦路虎,因此请帮助我解决此问题,并指导上面代码中的错误。如果可以帮到你,请尝试检查此项和此项。我已检查了上面的链接,但没有看到geeting添加两行后出现相同错误。嘿,你找到解决方案了吗?解决方案有任何更新吗?如果有帮助,请尝试检查此项和此项。我检查了上面的链接,但在添加两行后出现相同错误。嘿,你找到解决方案了吗?解决方案有任何更新吗?Android java.lang.NullPointerException:无身份验证头信息#467,android,performance,google-contacts-api,Android,Performance,Google Contacts Api,我的目标是从gmail中获取好友联系人列表,我已经检查了此异常的帖子编号,但没有人被正确的解决方案评论。它已成为我的拦路虎,因此请帮助我解决此问题,并指导上面代码中的错误。如果可以帮到你,请尝试检查此项和此项。我已检查了上面的链接,但没有看到geeting添加两行后出现相同错误。嘿,你找到解决方案了吗?解决方案有任何更新吗?如果有帮助,请尝试检查此项和此项。我检查了上面的链接,但在添加两行后出现相同错误。嘿,你找到解决方案了吗?解决方案有任何更新吗? private void setOauthP
private void setOauthParameter() {
GoogleOAuthParameters oauthParam = new GoogleOAuthParameters();
oauthParam.setOAuthConsumerKey(ClientId);
oauthParam.setOAuthConsumerSecret(ClientSecrate);
oauthParam.setOAuthType(OAuthParameters.OAuthType.TWO_LEGGED_OAUTH);
// Init the service and set the auth
service = new ContactsService("chat.com.contactssharing");
try {
service.setOAuthCredentials(oauthParam, new OAuthHmacSha1Signer());
service.getRequestFactory().setHeader("User-Agent", "chat.com.contactssharing");
} catch (OAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void queryEntries() throws IOException, ServiceException {
Query myQuery = new Query(feedUrl);
myQuery.setMaxResults(50);
myQuery.setStartIndex(1);
myQuery.setStringCustomParameter("showdeleted", "false");
myQuery.setStringCustomParameter("requirealldeleted", "false");
myQuery.setStringCustomParameter("sortorder", "ascending");
try {
// Execution of this line i'm getting an exception
ContactFeed resultFeed = (ContactFeed) this.service.query(myQuery, ContactFeed.class);
Log.d(TAG, resultFeed.toString());
for (ContactEntry entry : resultFeed.getEntries()) {
printContact(entry);
}
System.err.println("Total: " + resultFeed.getEntries().size() + " entries found");
} catch (Exception ex) {
System.err.println("Not all placehorders of deleted entries are available");
}
}