android - 从 Android 中的 Gmail 获取邮件列表

标签 android gmail

遇到这样的问题:我需要从我的 gmail 帐户中获取邮件列表。它显示在下面的 fragment 中:

Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
File file = new File("content://gmail-ls/messages/"+accounts[0].name+"/");
if(file.exists())
{
    Uri uri = Uri.parse("content://gmail-ls/messages"+accounts[0].name+"/");
    cursor = this.getContentResolver().query(uri, null, null, null, null);
}

但它不会进入“如果”条件,因为这样的路径不存在。在没有“if”条件的情况下,当我通过使用 Uri 的查询将游标分配给 gmail-ls 时,它会抛出异常。 任何人都知道如何解决这个问题?将不胜感激任何建议!

最佳答案

第三方应用似乎无法再从 Gmail 中读取电子邮件 引用 http://productforums.google.com/forum/#!msg/gmail/XD0C4sw9K7U/LpNXxFNnfgc

关于android - 从 Android 中的 Gmail 获取邮件列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8907810/

相关文章:

java - 如何获取 Google Talk 历史记录?

api - 如何允许我网站上的用户从 Google 通讯录中邀请 friend ?

Android 编程 ViewPager 从 GridView

email - 使用 SMTP、Gmail 和 STARTTLS

node.js - 使用 nodemailer 发送邮件时出现 TLS 错误

android - 未找到 ID 为 'com.android.application' 的插件 Android Studio

css - Mailchimp 和 Gmail : text color issue

android.support.design.widget.TabLayout 无法与 ViewPager 一起正常工作

java - 安卓 : When app close do something

android - Socket Web App - 处理移动超时/退出?