【发布时间】:2013-12-10 13:06:50
【问题描述】:
设备之间的蓝牙共享文件,获取:- 无法打开文件进行共享。
我想发送存储在图片目录中的图片,我的图片名称是:kitkat.jpg
我是否给出了错误的路径?
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setComponent(new ComponentName(
"com.android.bluetooth",
"com.android.bluetooth.opp.BluetoothOppLauncherActivity"));
intent.setType("image/jpeg");
File file = new File(Environment.getExternalStoragePublicDirectory
(Environment.DIRECTORY_PICTURES).toString() + "/kitkat.jpg");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
startActivity(intent);
【问题讨论】: