2

在我的应用程序中,我打开我的画廊并选择一张图片,然后在图像视图中显示我的图像,然后我应该通过蓝牙发送它。

这就是我所达到的:

Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};

Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
cursor.moveToFirst();

int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String filePath = cursor.getString(columnIndex);
cursor.close();
Bitmap yourSelectedImage = BitmapFactory.decodeFile(filePath);
iv.setImageBitmap(yourSelectedImage);

如何通过蓝牙发送?

注意我已经打开了我的蓝牙并使它也可以被其他设备发现。如果你在我的任务中帮助我,我将不胜感激 =]

4

0 回答 0