我的代码
public void onClick(View v)
{
String pos = applist.get(arg0);
File f = new File(path + pos);
Uri path = Uri.fromFile(f);
Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, path);
intent.setType("text/plain");
intent.setPackage("com.android.bluetooth");
startActivity(intent);
}
答案 0 :(得分:0)
你到底想要做什么?不确定因为文件和位置的事情我不清楚。
如果您只是想打开蓝牙设置,这段代码应该为您完成:
Intent intentOpenBluetoothSettings = new Intent();
intentOpenBluetoothSettings.setAction(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivity(intentOpenBluetoothSettings);
应该是应该的;)
希望我帮忙。享受