我想分享一个音频文件,该文件通过蓝牙存储到原始文件夹中,每当我尝试分享获取时: 文件未发送
InputStream inputStream = getResources().openRawResource(R.raw.rock_band);
String uri = "android.resource://" + getPackageName() + "/"+R.raw.rock_band;
Log.d("filePath::--", uri);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setComponent(new ComponentName(
"com.android.bluetooth",
"com.android.bluetooth.opp.BluetoothOppLauncherActivity"));
intent.setType("audio/mp3");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri));
startActivity(intent);
清单权限:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
请让我知道我在哪里做错了。
和日志说: -
D/filePath::--(1663): android.resource://com.productions.music/2131034112