简体   繁体   English

Gmail API Android快速入门示例不起作用

[英]Gmail API Android Quickstart Example Not Working

I want to use gmail api in one of my android app. 我想在我的一个Android应用程序中使用gmail api。 For that i am following this link : https://developers.google.com/gmail/api/quickstart/android 为此,我关注此链接: https : //developers.google.com/gmail/api/quickstart/android

I have followed all the instructions as given in the link. 我已按照链接中给出的所有说明进行操作。

When i ran the app Choose an account screen comes. 当我运行该应用程序时,会出现“选择帐户”屏幕。

在此处输入图片说明

When i select an account and clicks on OK then again same Choose an account screens opens. 当我选择一个帐户并单击“确定”,然后再次打开相同的“选择帐户”屏幕。 Strangely if i click on CANCEL also the same Choose an account screen reappears. 奇怪的是,如果我单击“取消”,还会出现相同的“选择帐户”屏幕。

I have checked logcat also there is no error. 我已经检查过logcat也没有错误。

I have tested this app on emulator as well as on real device. 我已经在模拟器以及真实设备上测试了该应用程序。

The issue remains the same. 问题仍然相同。

My build.gradle file is showing: 我的build.gradle文件显示:

 minSdkVersion 15
 targetSdkVersion 23

You are probably using marshmallow to test this. 您可能正在使用蛋白软糖对此进行测试。 The reason for this problem is that your app is not granted permissions to read contacts(on its own).So you either need to enable it manually from app settings or implement that permission grant api introduced in marshmallow. 出现此问题的原因是您的应用没有被授予读取联系人的权限(因此),您要么需要通过应用设置手动启用它,要么实现棉花糖中引入的权限授予api。 http://developer.android.com/training/permissions/requesting.html http://developer.android.com/training/permissions/requesting.html

ps-Just noticed we've got a common surname :P ps-刚注意到我们有一个共同的姓氏:P

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM