简体   繁体   English

保管箱图标未出现在共享托盘中

[英]Dropbox icon does not appear in sharing tray

I have a share button in my app that allows the sharing of the png/txt/pdf/etc.. files created in my app. 我的应用程序中有一个共享按钮,可共享在我的应用程序中创建的png / txt / pdf / etc ..文件。

When I click on it, the sharing Android tray appears with all the apps that can be used for sharing. 当我单击它时,将显示共享Android托盘以及所有可用于共享的应用程序。 Many apps are displayed (Gmail, Drive, Whatsapp, Telegram, Skype, OneDrive, etc...) but not Dropbox (that is installed on my device). 显示了许多应用程序(Gmail,驱动器,Whatsapp,电报,Skype,OneDrive等),但没有显示Dropbox(已安装在我的设备上)。

Here is the code I use for sharing : 这是我用于共享的代码:

 Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
        emailIntent.setType("vnd.android.cursor.dir/email");      
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailTitle);

    String text = "xxxxxx";

    emailIntent.putExtra(Intent.EXTRA_TEXT, text);

    emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);   

    ArrayList<Uri> uris = getUris();

    emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
    activity.startActivityForResult(Intent.createChooser(emailIntent , "Send email..."), 12);

What could I do to have also Dropbox in the list of apps proposed by the system for sharing? 如何将Dropbox包含在系统建议共享的应用程序列表中?

Thanks ! 谢谢 !

You have no control over what to show in Share tray. 您无法控制“共享”托盘中显示的内容。 You can just specify what your intention is. 您可以只指定您的意图。 I mean what your Intent will share if the type of the intent is supported by any application installed, it will automatically be populated by the System in the Share tray 我的意思是,如果所安装的任何应用程序都支持该意图的类型,那么该意图将由“共享”托盘中的“系统”自动填充

Some sample code to send a file 一些发送文件的示例代码

final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(Intent.EXTRA_TEXT, shareText);
        intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
        intent.setType("image/png");
        startActivity(Intent.createChooser(intent, "Share image via"));

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

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