我看到了你通过蓝牙发送文件的答案.(回答于2011年6月13日5:01)
Intent i = new Intent(Intent.ACTION_SEND); i.setType("image/jpeg");
i.putExtra(Intent.EXTRA_STREAM, Uri.parse("/sdcard/file.jpg"));
startActivity(Intent.createChooser(i, "Send Image"));
Run Code Online (Sandbox Code Playgroud)
是! 有用.它将打开一个默认的蓝牙工具/窗口/对话框来发送文件.但是,请你教我如何发送更多文件?这是我的代码......
String xFile[3] = { "aa.txt", "bb.txt", "cc.txt" };
Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain");
for (int i = 0; i < 3; i ++) {
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(xFile[i])));
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
它可以工作,但它将打开默认的蓝牙工具/窗口/对话3次!@@如果有10个文件,它将打开默认的蓝牙工具/窗口/对话框10次!
我可以知道如何打开默认的蓝牙工具/窗口/对话框一次,然后发送所有文件?
非常感谢你提前!