意向选择照片或视频 [英] Intent to select Photo Or Video

查看:158
本文介绍了意向选择照片或视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  多MIME类型在Android中

我有一个要求,其中我必须让用户选择的照片或视频。
这可以在一个单一的意图来完成?
目前,我问用户,如果他想选择的照片或视频,并根据他的投入我设置的意图不是图像/ * 或<$ C的MIME类型$ C>视频/ *

I have a requirement wherein I have to let the user select either a photo or a video. Can this be done in a single intent? Currently I am asking user if he wants to select photo or a video and based on his input I set mime type of the intent either "image/*" or "video/*".

有没有一种方法可以让用户在一个单一的意向选择照片/视频?

Is there a way to allow user to select photo/video in a single intent?

谢谢,
Yogesh

Thanks, Yogesh

推荐答案

您可以尝试这样的事:

Android的文件对话框

这是允许下面的功能了。

This is allowing following feature too.

FORMAT_FILTER - 文件过滤器。如果文件名过滤器一端
  该文件将被显示出来。

FORMAT_FILTER - files filter. If file name ends with one of filters the file will be displayed.

所以,你可以用这个指定所需的过滤器,并提供不同的文件选择给用户。

So, you can specify required filters with this and provide selection of different files to users.

希望它可以帮助你。

感谢。

这篇关于意向选择照片或视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆