分享意图与蓝牙选项只 [英] Share Intent with Bluetooth Option Only
本文介绍了分享意图与蓝牙选项只的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用我的应用程序发送文件通过蓝牙。
我已经改变了MIME类型随机的东西作为asdxasd / asdxa
而该文件有一个扩展,我需要使用,那就是.sso
当我用它仅出现在蓝牙和Gmail选项份额的意图,但我不能从列表中删除Gmail的选项?
非常感谢提前!
我用这code。使用意图发送:
文件=新的文件系统(本).saveTemp();意图sharingIntent =新意图(Intent.ACTION_SEND);
乌里screenshotUri = Uri.fromFile(文件);sharingIntent.setType(测试/ onlineconfig);
sharingIntent.putExtra(Intent.EXTRA_STREAM,screenshotUri);
startActivity(Intent.createChooser(sharingIntent,共享配置使用));
解决方案
意图sharingIntent =新意图(Intent.ACTION_SEND);
乌里screenshotUri = Uri.parse(picURI);sharingIntent.setType(图像/ *);
sharingIntent.setPackage(com.android.bluetooth);
sharingIntent.putExtra(Intent.EXTRA_STREAM,screenshotUri);
startActivity(Intent.createChooser(sharingIntent,分享图片));
I am trying to send a file over bluetooth using my app. I already changed the mime type to something random as asdxasd/asdxa And the file has an extension that I need to use, that is .sso
When I use the share intent it only appears the bluetooth and gmail option, but can't I delete the gmail option from the list ?
Thanks alot in advance! I am using this code to send it using the intent:
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"));
解决方案
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"));
这篇关于分享意图与蓝牙选项只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文