Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

MutiPhotoChoser

一款支持多选的图片选择器,支持Android2.0+

Screenshot

使用(详见app目录)

配置AndroidManifest.xml

1、添加权限:

 <!--SD卡读写权限-->
 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 <uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />

2、声明GalleryActivity:

<activity android:name="com.ns.mutiphotochoser.GalleryActivity">
    <intent-filter>
        <!--***改成应用的包名-->
        <action android:name="***.action.CHOSE_PHOTOS" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

调起图片选择页面选择图片

/*改成应用的包名*/
Intent intent = new Intent("***.action.CHOSE_PHOTOS");
startActivityForResult(intent, REQUEST_PICK_PHOTO);

处理选择结果

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK) {
        return;
    }

    switch (requestCode) {
        case REQUEST_PICK_PHOTO:
            ArrayList<String> images = data.getStringArrayListExtra(Constant.EXTRA_PHOTO_PATHS);
            mAdaper.swapDatas(images);
            break;
    }
}

License

Mozilla Public License, version 2.0

Comments ( 0 )

Sign in for post a comment

About

一款支持多选的图片选择器,支持Android2.0+ spread retract
MPL-2.0
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more