6

我正在尝试使用我的应用程序通过蓝牙发送文件。我已经将 mime 类型更改为随机的 asdxasd/asdxa 并且该文件有一个我需要使用的扩展名,即 .sso

当我使用共享意图时,它只显示蓝牙和 gmail 选项,但我不能从列表中删除 gmail 选项吗?

提前非常感谢!我正在使用此代码使用意图发送它:

file = new FileSystem(this).saveTemp();

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.fromFile(file);

sharingIntent.setType("test/onlineconfig");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share Config Using"));
4

2 回答 2

12
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse(picURI);

sharingIntent.setType("image/*");
sharingIntent.setPackage("com.android.bluetooth");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image"));
于 2013-05-26T02:53:59.327 回答
2

如果您有设备图像的路径,则使用:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.setPackage("com.android.bluetooth");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagepath)));
startActivity(Intent.createChooser(intent, "Share image"));
于 2015-02-19T07:04:33.363 回答