android beam传输文件,如何在Android中使用NFC(Android Beam)接收文件
从Receiving Files from Another Device开始:Note: For Android Beam file transfer, you receive a content URI in the ACTION_VIEW intent if the first incoming file has a MIME type of “audio/*”, “image/*”, or
从
Receiving Files from Another Device开始:
Note: For Android Beam file transfer, you receive a content URI in the ACTION_VIEW intent if the first incoming file has a MIME type of “audio/*”, “image/*”, or “video/*”, indicating that the file is media- related.
由于< data ... />的方式处理过滤器(参见Data Test和Data Element),您的意图过滤器转换为
> intent action VIEW和MIME类型“image / *”和带有方案“file:”的URI,或
> intent action VIEW和MIME类型“video / *”和带有方案“file:”的URI.
因此它必须匹配任何MIME类型和数据元素中给出的任何URI.
因此,您的intent过滤器永远不会匹配,“image / *”MIME类型和“video / *”MIME类型将导致内容URI而不是“file:”URI.因此,要么跳过URI过滤器部分,要么将过滤后的方案转换为“内容”应该可以解决问题.
要么
更多推荐
所有评论(0)