Bluetooth 経由でファイルを送信することに関するあなたの回答を見ました。(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"));
はい!できます。ファイルを送信するために、デフォルトの Bluetooth ツール/ウィンドウ/ダイアログが開きます。でも、もっとファイルを送信する方法を教えてください。これが私のコードです...
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);
}
動作しますが、デフォルトの Bluetooth ツール/ウィンドウ/ダイアログが 3 回開きます。@@ ファイルが 10 個ある場合、デフォルトの Bluetooth ツール/ウィンドウ/ダイアログが 10 回開きます!!
デフォルトの Bluetooth ツール/ウィンドウ/ダイアログを一度開いてから、すべてのファイルを送信する方法を教えてください。
事前にどうもありがとうございました!