【问题标题】:Get list of mails from Gmail in Android从 Android 中的 Gmail 获取邮件列表
【发布时间】:2012-01-18 09:26:35
【问题描述】:

有这样的问题:我需要从我的 gmail 帐户中获取邮件列表。如下图sn-p所示:

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

【问题讨论】:

  • 顺便说一句,我拥有所有基本权限:

标签: android gmail


【解决方案1】:

第三方应用似乎无法再读取来自 Gmail 的电子邮件 参考http://productforums.google.com/forum/#!msg/gmail/XD0C4sw9K7U/LpNXxFNnfgc

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-19
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    相关资源
    最近更新 更多