我们可以使用Android支持库将Intent.EXTRA_ALLOW_MULTIPLE用于旧版本的Android API级别吗? [英] Can we use Intent.EXTRA_ALLOW_MULTIPLE for older versions of Android API levels using Android Support Library?

查看:274
本文介绍了我们可以使用Android支持库将Intent.EXTRA_ALLOW_MULTIPLE用于旧版本的Android API级别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Intent.EXTRA_ALLOW_MULTIPLE 文档:

用来表示ACTION_GET_CONTENT意图可以允许用户 选择并返回多个项目.这是布尔附加值;这 默认为false.如果为true,则ACTION_GET_CONTENT的实现为 允许向用户展示一个用户界面,用户可以在其中选择多个 所有返回给呼叫者的项目.发生这种情况时,他们 应该作为结果Intent的getClipData()部分返回.

Used to indicate that a ACTION_GET_CONTENT intent can allow the user to select and return multiple items. This is a boolean extra; the default is false. If true, an implementation of ACTION_GET_CONTENT is allowed to present the user with a UI where they can pick multiple items that are all returned to the caller. When this happens, they should be returned as the getClipData() part of the result Intent.

因此我们可以将其用作:

So we can use it as:

startActivityForResult(new Intent(Intent.ACTION_GET_CONTENT).putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true).setType("image/*");

但这仅适用于Android API 18+.

But this is available for Android API 18+ only.

所以我的问题是,我们可以使用Android支持库将其用于旧版本的Android API级别吗?

So my question is can we use it for older versions of Android API levels using Android Support Library?

如果是,如何?

推荐答案

我们是否可以将其用于使用Android的旧版Android API级别 支持库?

can we use it for older versions of Android API levels using Android Support Library?

不,我们不能,Intent.EXTRA_ALLOW_MULTIPLE至少目前没有包含在Android支持库中.

No, we can't, Intent.EXTRA_ALLOW_MULTIPLE is not included in the Android Support Library, at least at this moment.

这篇关于我们可以使用Android支持库将Intent.EXTRA_ALLOW_MULTIPLE用于旧版本的Android API级别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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