1
我目前正試圖通過藍牙將可穿戴設備(MOTO 360 Android 5.1.1)的文本文件發送到我的手機(Moto X Android 4.4.4),但是當我執行「onSendToPhone」的方法我上觀看以下錯誤信息:從Andread Wear的數據傳輸手錶通過藍牙手機
No application can handle this action
也許有人可以幫助我,找到解決辦法;)
這是我使用將數據從手錶傳輸碼:
public void onSendToPhone(View view)
{
//...
// inside method
// Check if bluetooth is supported
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
if (btAdapter == null) {
// Device does not support Bluetooth
// Inform user that we're done.
Log.d("TAG","Bluetooth not found");
return;
}
File sendFile= new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "<filename>");
// bring up Android chooser
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(sendFile));
startActivity(intent);
Log.d("TAG", "File is sent via Bluetooth");
}