首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在Android11作用域存储中使用.status文件夹作为WhatsApp状态保护程序?

如何在Android11作用域存储中使用.status文件夹作为WhatsApp状态保护程序?
EN

Stack Overflow用户
提问于 2022-02-22 14:49:19
回答 1查看 1.7K关注 0票数 0

嘿,伙计们,我做了一个WhatsApp状态保护程序。但是在android 11中,Google引入了作用域存储,所以我无法在应用程序中获得用户的状态。为此,我使用了MANAGE_EXTERNAL_STORAGE,但由于这个原因,我无法在Google中发布该应用。我见过很少有应用程序使用某种权限来授予使用.status文件夹的权限。怎么做?我已经附上了该应用程序要求的许可的屏幕截图。我是初学者,所以请帮帮我。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-21 21:48:34

请求用户向WhatsApp状态存储文件夹授予权限。

代码语言:javascript
运行
复制
private void checkWhatsAppPermission(){
    // Choose a directory using the system's file picker.
    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
    // Optionally, specify a URI for the directory that should be opened in
    // the system file picker when it loads.

    Uri wa_status_uri = Uri.parse("content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses");
    intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, wa_status_uri);
    startActivityForResult(intent, 10001);
}

您可以在这里使用上述方法检查一个工作示例。https://play.google.com/store/apps/details?id=com.larntech.whatsappstatussaver

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71223399

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档