Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share Intent with Bluetooth Option Only

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"));
like image 310
TiagoM Avatar asked May 26 '13 02:05

TiagoM


2 Answers

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"));
like image 91
Bishan Avatar answered Sep 19 '22 01:09

Bishan


if you have the path of image of device then use :

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"));
like image 45
Akshay Paliwal Avatar answered Sep 20 '22 01:09

Akshay Paliwal