简体   繁体   English

在Android中访问Gmail标签API

[英]Accessing the gmail labels api in android

I've got an app in the play store which reads the gmail labels (based on the sample app provided on the google blog) 我在Play商店中有一个可以读取gmail标签的应用(基于Google博客上提供的示例应用)

It works fine for most people, but for some they get the following error from the app: 对于大多数人来说,它工作正常,但对于某些人,他们会从应用程序中收到以下错误:

 "java.lang.SecurityException: Permission Denial: reading com.google.android.gm.provider.PublicContentProvider uri content://com.google.android.gm/test@example.com/labels from pid=29069, uid=10087 requires com.google.android.gm.permission.READ_CONTENT_PROVIDER, or grantUriPermission()"

The code I'm using is: 我使用的代码是:

Cursor c = context.getContentResolver().query(GmailContract.Labels.getLabelsUri(accountName),null, null, null, null);

And my manifest file has: 我的清单文件有:

<uses-permission android:name="com.google.android.gm.permission.READ_CONTENT_PROVIDER" />

Therefore I've no idea why some people they get this error. 因此,我不知道为什么有些人会收到此错误。 It's not just a handful of people, there's over 100 people that have reported this (but thousands that haven't) 这不仅是少数人,还有100多个人报告了此消息(但数千人没有报告)

Can anyone shed any light? 谁能阐明任何想法?

I'm not familiar with java. 我对Java不熟悉。 But, Sms Backup Plus application includes a similar feature. 但是, Sms Backup Plus应用程序包含类似的功能。 Be useful to consider. 考虑有用。

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

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