如何从内部存储共享音频文件

时间:2021-03-08 15:00:46

标签: android-recyclerview share delete-file internal-storage sharefile

   public void onShareClick(int position){
       String sharePath = Environment.getExternalStorageDirectory().getPath()
               + "/My Device/Allah_O_Akbar.mp3";
       Uri uri = Uri.parse("file://" + sharePath);
       Intent share = new Intent(Intent.ACTION_SEND);
       share.setType("audio/*");
       share.putExtra(Intent.EXTRA_STREAM, uri);
       startActivity(Intent.createChooser(share, "Share Sound File"));
   }

我正在使用此代码从 recylerview 菜单共享音频,当我共享音频时,它显示不支持文件格式的吐司"check image to understand error"

0 个答案:

没有答案