String path = Environment.getExternalStorageDirectory() + "/aaaw.mp3";
File f = new File(path);
getUriForFile(getContext(), "haydo.kufurbaz.kfrbazhaydosesleri", f);
Uri contentUri = FileProvider.getUriForFile(getContext(), "haydo.kufurbaz.kfrbazhaydosesleri.fileprovider", f);
Intent myınIntent = new Intent(Intent.ACTION_SEND);
myınIntent.setType("audio/*");
String sharebody = "Your body here";
myınIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
startActivity(Intent.createChooser(myınIntent, "Share using"));
myınIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
myınIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
myınIntent.setData(contentUri);
return true;
它会引发错误:
尝试调用虚方法' android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager,java.lang.String)'在空对象引用上
请帮帮我。