How can I upload multiple images from gallery?
up vote
0
down vote
favorite
I can choose single image from gallery but can't choose multiple images.
I google information about that and found add EXTRA_ALLOW_MULTIPLE to putExtra, but it doesn't work for me. Can anyone help me?
My problem is file upload on webview. I am targeting at os6, os7 or os8.
my code :
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
i.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
update
Thanks everyone. Finally, I can choose both single image or multiple images from gallery. This is my solution, I need to clean up unnecessary code though.
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.setType("image/*");
i.addCategory(Intent.CATEGORY_OPENABLE);
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (uploadMessage != null) {
uploadMessage.onReceiveValue(null);
uploadMessage = null;
}
uploadMessage = filePathCallback;
Intent intent = fileChooserParams.createIntent();
intent.setType("image/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
try {
startActivityForResult(intent, REQUEST_SELECT_FILE);
} catch (ActivityNotFoundException e) {
uploadMessage = null;
Toast.makeText(MainActivity.this.getApplicationContext(), "can't choose files", Toast.LENGTH_LONG).show();
return false;
}
return true;
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (requestCode == REQUEST_SELECT_FILE) {
if (uploadMessage == null) return;
ClipData clipData = intent.getClipData();
if (clipData != null && clipData.getItemCount() > 0) {
Uri results = new Uri[clipData.getItemCount()];
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(i);
results[i] = item.getUri();
}
uploadMessage.onReceiveValue(results);
uploadMessage = null;
} else {
uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
uploadMessage = null;
}
}
} else if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage) return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
} else {
Toast.makeText(MainActivity.this.getApplicationContext(), "fail to upload files", Toast.LENGTH_LONG).show();
}
}


add a comment |
up vote
0
down vote
favorite
I can choose single image from gallery but can't choose multiple images.
I google information about that and found add EXTRA_ALLOW_MULTIPLE to putExtra, but it doesn't work for me. Can anyone help me?
My problem is file upload on webview. I am targeting at os6, os7 or os8.
my code :
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
i.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
update
Thanks everyone. Finally, I can choose both single image or multiple images from gallery. This is my solution, I need to clean up unnecessary code though.
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.setType("image/*");
i.addCategory(Intent.CATEGORY_OPENABLE);
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (uploadMessage != null) {
uploadMessage.onReceiveValue(null);
uploadMessage = null;
}
uploadMessage = filePathCallback;
Intent intent = fileChooserParams.createIntent();
intent.setType("image/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
try {
startActivityForResult(intent, REQUEST_SELECT_FILE);
} catch (ActivityNotFoundException e) {
uploadMessage = null;
Toast.makeText(MainActivity.this.getApplicationContext(), "can't choose files", Toast.LENGTH_LONG).show();
return false;
}
return true;
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (requestCode == REQUEST_SELECT_FILE) {
if (uploadMessage == null) return;
ClipData clipData = intent.getClipData();
if (clipData != null && clipData.getItemCount() > 0) {
Uri results = new Uri[clipData.getItemCount()];
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(i);
results[i] = item.getUri();
}
uploadMessage.onReceiveValue(results);
uploadMessage = null;
} else {
uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
uploadMessage = null;
}
}
} else if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage) return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
} else {
Toast.makeText(MainActivity.this.getApplicationContext(), "fail to upload files", Toast.LENGTH_LONG).show();
}
}


github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
Deletei.setAction(Intent.ACTION_PICK);
and hope for the best.
– CommonsWare
Nov 19 at 12:04
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I can choose single image from gallery but can't choose multiple images.
I google information about that and found add EXTRA_ALLOW_MULTIPLE to putExtra, but it doesn't work for me. Can anyone help me?
My problem is file upload on webview. I am targeting at os6, os7 or os8.
my code :
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
i.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
update
Thanks everyone. Finally, I can choose both single image or multiple images from gallery. This is my solution, I need to clean up unnecessary code though.
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.setType("image/*");
i.addCategory(Intent.CATEGORY_OPENABLE);
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (uploadMessage != null) {
uploadMessage.onReceiveValue(null);
uploadMessage = null;
}
uploadMessage = filePathCallback;
Intent intent = fileChooserParams.createIntent();
intent.setType("image/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
try {
startActivityForResult(intent, REQUEST_SELECT_FILE);
} catch (ActivityNotFoundException e) {
uploadMessage = null;
Toast.makeText(MainActivity.this.getApplicationContext(), "can't choose files", Toast.LENGTH_LONG).show();
return false;
}
return true;
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (requestCode == REQUEST_SELECT_FILE) {
if (uploadMessage == null) return;
ClipData clipData = intent.getClipData();
if (clipData != null && clipData.getItemCount() > 0) {
Uri results = new Uri[clipData.getItemCount()];
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(i);
results[i] = item.getUri();
}
uploadMessage.onReceiveValue(results);
uploadMessage = null;
} else {
uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
uploadMessage = null;
}
}
} else if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage) return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
} else {
Toast.makeText(MainActivity.this.getApplicationContext(), "fail to upload files", Toast.LENGTH_LONG).show();
}
}


I can choose single image from gallery but can't choose multiple images.
I google information about that and found add EXTRA_ALLOW_MULTIPLE to putExtra, but it doesn't work for me. Can anyone help me?
My problem is file upload on webview. I am targeting at os6, os7 or os8.
my code :
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
i.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
update
Thanks everyone. Finally, I can choose both single image or multiple images from gallery. This is my solution, I need to clean up unnecessary code though.
mWebview.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.setType("image/*");
i.addCategory(Intent.CATEGORY_OPENABLE);
i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (uploadMessage != null) {
uploadMessage.onReceiveValue(null);
uploadMessage = null;
}
uploadMessage = filePathCallback;
Intent intent = fileChooserParams.createIntent();
intent.setType("image/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
try {
startActivityForResult(intent, REQUEST_SELECT_FILE);
} catch (ActivityNotFoundException e) {
uploadMessage = null;
Toast.makeText(MainActivity.this.getApplicationContext(), "can't choose files", Toast.LENGTH_LONG).show();
return false;
}
return true;
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (requestCode == REQUEST_SELECT_FILE) {
if (uploadMessage == null) return;
ClipData clipData = intent.getClipData();
if (clipData != null && clipData.getItemCount() > 0) {
Uri results = new Uri[clipData.getItemCount()];
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(i);
results[i] = item.getUri();
}
uploadMessage.onReceiveValue(results);
uploadMessage = null;
} else {
uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
uploadMessage = null;
}
}
} else if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage) return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
} else {
Toast.makeText(MainActivity.this.getApplicationContext(), "fail to upload files", Toast.LENGTH_LONG).show();
}
}




edited 2 days ago
asked Nov 19 at 11:03
Ken
295
295
github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
Deletei.setAction(Intent.ACTION_PICK);
and hope for the best.
– CommonsWare
Nov 19 at 12:04
add a comment |
github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
Deletei.setAction(Intent.ACTION_PICK);
and hope for the best.
– CommonsWare
Nov 19 at 12:04
github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
Delete
i.setAction(Intent.ACTION_PICK);
and hope for the best.– CommonsWare
Nov 19 at 12:04
Delete
i.setAction(Intent.ACTION_PICK);
and hope for the best.– CommonsWare
Nov 19 at 12:04
add a comment |
3 Answers
3
active
oldest
votes
up vote
0
down vote
Intent intent = new Intent();
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image*//*");
String extraMimeTypes = {"image/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, REQUEST_CODE_GALLERY);
Try this. Working in all versions.
SinceACTION_OPEN_DOCUMENT
was only added in API Level 19, and sinceimage*//*
is not a valid MIME type, this code definitely does not work "in all versions".
– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
add a comment |
up vote
0
down vote
use image picker
ImagePicker.create(UploadPhotosActivity.this)
.showCamera(false)
.limit(2) // set your limit here
.imageTitle(getString(R.string.select_image))
.folderTitle(getString(R.string.folder))
.theme(R.style.ImagePickerTheme)
.start(RC_CODE_PICKER);
add these to your dependency
compile 'com.github.esafirm.android-image-picker:imagepicker:1.5.0'
compile 'com.github.esafirm.android-image-picker:rximagepicker:1.5.0'
There is nothing namedImagePicker
in the Android SDK.
– CommonsWare
Nov 19 at 12:02
add a comment |
up vote
0
down vote
Edit your code i.e. Remove:
i.setAction(Intent.ACTION_PICK);
Follow below code :
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Intent intent = new Intent();
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image*//*");
String extraMimeTypes = {"image/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, REQUEST_CODE_GALLERY);
Try this. Working in all versions.
SinceACTION_OPEN_DOCUMENT
was only added in API Level 19, and sinceimage*//*
is not a valid MIME type, this code definitely does not work "in all versions".
– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
add a comment |
up vote
0
down vote
Intent intent = new Intent();
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image*//*");
String extraMimeTypes = {"image/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, REQUEST_CODE_GALLERY);
Try this. Working in all versions.
SinceACTION_OPEN_DOCUMENT
was only added in API Level 19, and sinceimage*//*
is not a valid MIME type, this code definitely does not work "in all versions".
– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
add a comment |
up vote
0
down vote
up vote
0
down vote
Intent intent = new Intent();
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image*//*");
String extraMimeTypes = {"image/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, REQUEST_CODE_GALLERY);
Try this. Working in all versions.
Intent intent = new Intent();
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image*//*");
String extraMimeTypes = {"image/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, REQUEST_CODE_GALLERY);
Try this. Working in all versions.
answered Nov 19 at 11:33


Jayanth vn
4714
4714
SinceACTION_OPEN_DOCUMENT
was only added in API Level 19, and sinceimage*//*
is not a valid MIME type, this code definitely does not work "in all versions".
– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
add a comment |
SinceACTION_OPEN_DOCUMENT
was only added in API Level 19, and sinceimage*//*
is not a valid MIME type, this code definitely does not work "in all versions".
– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
Since
ACTION_OPEN_DOCUMENT
was only added in API Level 19, and since image*//*
is not a valid MIME type, this code definitely does not work "in all versions".– CommonsWare
Nov 19 at 12:02
Since
ACTION_OPEN_DOCUMENT
was only added in API Level 19, and since image*//*
is not a valid MIME type, this code definitely does not work "in all versions".– CommonsWare
Nov 19 at 12:02
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
@CommonsWare I mean whatever versions he required. He mentioned " I am targeting at os6, os7 or os8".
– Jayanth vn
yesterday
add a comment |
up vote
0
down vote
use image picker
ImagePicker.create(UploadPhotosActivity.this)
.showCamera(false)
.limit(2) // set your limit here
.imageTitle(getString(R.string.select_image))
.folderTitle(getString(R.string.folder))
.theme(R.style.ImagePickerTheme)
.start(RC_CODE_PICKER);
add these to your dependency
compile 'com.github.esafirm.android-image-picker:imagepicker:1.5.0'
compile 'com.github.esafirm.android-image-picker:rximagepicker:1.5.0'
There is nothing namedImagePicker
in the Android SDK.
– CommonsWare
Nov 19 at 12:02
add a comment |
up vote
0
down vote
use image picker
ImagePicker.create(UploadPhotosActivity.this)
.showCamera(false)
.limit(2) // set your limit here
.imageTitle(getString(R.string.select_image))
.folderTitle(getString(R.string.folder))
.theme(R.style.ImagePickerTheme)
.start(RC_CODE_PICKER);
add these to your dependency
compile 'com.github.esafirm.android-image-picker:imagepicker:1.5.0'
compile 'com.github.esafirm.android-image-picker:rximagepicker:1.5.0'
There is nothing namedImagePicker
in the Android SDK.
– CommonsWare
Nov 19 at 12:02
add a comment |
up vote
0
down vote
up vote
0
down vote
use image picker
ImagePicker.create(UploadPhotosActivity.this)
.showCamera(false)
.limit(2) // set your limit here
.imageTitle(getString(R.string.select_image))
.folderTitle(getString(R.string.folder))
.theme(R.style.ImagePickerTheme)
.start(RC_CODE_PICKER);
add these to your dependency
compile 'com.github.esafirm.android-image-picker:imagepicker:1.5.0'
compile 'com.github.esafirm.android-image-picker:rximagepicker:1.5.0'
use image picker
ImagePicker.create(UploadPhotosActivity.this)
.showCamera(false)
.limit(2) // set your limit here
.imageTitle(getString(R.string.select_image))
.folderTitle(getString(R.string.folder))
.theme(R.style.ImagePickerTheme)
.start(RC_CODE_PICKER);
add these to your dependency
compile 'com.github.esafirm.android-image-picker:imagepicker:1.5.0'
compile 'com.github.esafirm.android-image-picker:rximagepicker:1.5.0'
edited Nov 19 at 12:07
answered Nov 19 at 11:26


Kevin Kurien
3949
3949
There is nothing namedImagePicker
in the Android SDK.
– CommonsWare
Nov 19 at 12:02
add a comment |
There is nothing namedImagePicker
in the Android SDK.
– CommonsWare
Nov 19 at 12:02
There is nothing named
ImagePicker
in the Android SDK.– CommonsWare
Nov 19 at 12:02
There is nothing named
ImagePicker
in the Android SDK.– CommonsWare
Nov 19 at 12:02
add a comment |
up vote
0
down vote
Edit your code i.e. Remove:
i.setAction(Intent.ACTION_PICK);
Follow below code :
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
add a comment |
up vote
0
down vote
Edit your code i.e. Remove:
i.setAction(Intent.ACTION_PICK);
Follow below code :
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
add a comment |
up vote
0
down vote
up vote
0
down vote
Edit your code i.e. Remove:
i.setAction(Intent.ACTION_PICK);
Follow below code :
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
Edit your code i.e. Remove:
i.setAction(Intent.ACTION_PICK);
Follow below code :
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
answered Nov 19 at 12:39


Rishav Singla
34228
34228
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373226%2fhow-can-i-upload-multiple-images-from-gallery%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
github.com/siralam/BSImagePicker
– Vivek Mishra
Nov 19 at 11:05
This question has been asked before. You can have a look at this solution.
– Razor
Nov 19 at 11:11
Delete
i.setAction(Intent.ACTION_PICK);
and hope for the best.– CommonsWare
Nov 19 at 12:04