意图获取多张图片 [英] Intent for getting multiple images

查看:171
本文介绍了意图获取多张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有意向申请获得多张图片?

Is there an intent requesting to get multiple images?

我们都知道 Intent.ACTION_PICK Intent.ACTION_GET_CONTENT 获取一幅图像。另外我们的应用程序注册为IntentFilter的为 android.intent.action.SEN D和 android.intent.action.SEND_MULTIPLE。

We are aware of Intent.ACTION_PICK or Intent.ACTION_GET_CONTENT for getting a single image. Also our app registers as IntentFilter for android.intent.action.SEND and android.intent.action.SEND_MULTIPLE.

不过,我们希望我们的应用程序,以充分利用库的应用程序一样挑选多张图像。是否有一个意图是什么?

However, we would like our app to make use of Gallery like applications to pick multiple images. Is there an intent for that?

推荐答案

我也想为意向中的Andr​​oid挑选多张图片,但我failed.I碰到定制画廊自定义主题。

I also wanted Intent for picking multiple images in android but I failed.I came across custom gallery with custom theme.

在这里看看 MultipleImagePick 挑选单一的形象,并选择多个图片,你也可以根据自己的应用程序更改主题。

Look at here MultipleImagePick to pick single image and to pick multiple image and also you can change theme according to your app.

更新

感谢@ 阳光指导我限制最大图像的选择。我张贴低于code帮助任何人其他人,请接受这个编辑。

Thanks @sunshine for guiding me to limit maximum images selection. I am posting code below to help anyone other people, please accept this edit.

in CustomGalleryActivity.java 

AdapterView.OnItemClickListener mItemMulClickListener = new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> l, View v, int position, long id) {
            if (adapter.getSelected().size() >= MAX_IMAGE_SELECTION_LENGTH) {
                Toast.makeText(getApplicationContext(), "maximum items selected", Toast.LENGTH_LONG).show();
            } else {
                adapter.changeSelection(v, position);
            }

        }
    };

这篇关于意图获取多张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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