我使用Android Intent
和ACTION_SEND
和EXTRA_STREAM
通過ContentProvider
共享生成的PNG。這適用於電子郵件/ GMail,Flickr,MMS等,但如果我從活動選擇器對話框中選擇藍牙,則不起作用。與藍牙一起使用ACTION_SEND
該設備是運行Android 2.1的HTC Legend。該設備能夠通過藍牙與我的計算機共享圖像,而不是在我的應用程序調用時。我得到一個消息乾杯用以下文字:
藍牙共享:文件未知文件不會被髮送
的logcat的輸出不是特別豐富。唯一的錯誤級別條目如下,它在我的ContentProvider
的query
方法被調用(其本身由openFileHelper
方法調用)之後似乎立即發生。沒有堆棧跟蹤。
E/BluetoothOppSendFileInfo( 337): scheme: content, authority: mydomain.myapp.myprovider
我已經通過Android Bluetooth source code搜索,我無法找到是這樣寫不提供信息的日誌信息在哪裏。
也許我的ContentProvider
有什麼問題,但我不知道看到了什麼,因爲它適用於其他意向目標。
是否有人知道我可能無知的任何藍牙特定陷阱?
對於它的價值,這裏就是我的ContentProvider
樣子:
@Override
public Cursor query(Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder)
{
if (uri.equals(CONTENT_URI))
{
String[] columns = projection == null
? new String[]{"uri", "mime_type", "_data"}
: projection;
MatrixCursor cursor = new MatrixCursor(columns);
cursor.addRow(getColumns(columns));
return cursor;
}
throw new IllegalArgumentException("Unsupported URI");
}
@Override
public ParcelFileDescriptor openFile(Uri uri,
String mode) throws FileNotFoundException
{
return openFileHelper(uri, mode);
}