将“保存到图库”添加到可用于共享意图的目标列表中

问题描述

我有一种方法可以将图像共享到应用程序的目标列表中,并且正在尝试将图库添加到列表中,以便将图像保存在本地

The list of apps that accept sharing

这是我的分享方法

File newFile = new File(imagePath,"image.png");


    Uri contentUri = FileProvider.getUriForFile(this,BuildConfig.APPLICATION_ID + ".provider",newFile);

    if (contentUri != null) {
        Log.d(TAG,"shareImage: GOOD URI");

        Intent sendIntent = new Intent();
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT,"Created in NotanIzer.");
        sendIntent.putExtra(Intent.EXTRA_STREAM,contentUri);

        sendIntent.setType("image/*");

        Intent shareIntent = Intent.createChooser(sendIntent,null);
        startActivity(shareIntent);

        hideSpinner();

是否可以使用“保存到图库”方法将图标添加到列表中?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)