How to use on Java. Could you give some sample
See original GitHub issueHi! A lot of thanks for your job!
I used before https://github.com/Dhaval2404/ImagePicker , but Google send a letter “We’ve detected that your app contains the requestLegacyExternalStorage flag in the manifest file of 1 or more of your app bundles or APKs.”
And I found your comments and your library, so…
My old code was:
private void avatarTouch() {
ImagePicker.Companion.with(this)
.crop(1f, 1f)
.compress(1024)
.maxResultSize(1080, 1080)
.start();
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
Uri uri = data.getData();
//File file = ImagePicker.Companion.getFile(data);
//String filePath = ImagePicker.Companion.getFilePath(data);
if (uri != null) {
Picasso.get().load(uri).into(viewManager.avatarImageView);
}
} else if (resultCode == ImagePicker.RESULT_ERROR) {
// Error
Map<String, String> map = new HashMap<>();
map.put("error", ImagePicker.Companion.getError(data));
FirebaseModel.shared().sendAnalytics(MyApplication.context, "image_picker_error", map);
Toast.makeText(MyApplication.context, ImagePicker.Companion.getError(data), Toast.LENGTH_LONG).show();
} else {
// Cancel
}
}
Could you please help me to change my code. I can’t find an example on java how to use your library 😦 Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (10 by maintainers)
Top Results From Across the Web
Java Coding Samples
Java Coding Samples. Various Java programs to illustrate various concepts. A Hello World! Java program. Calling Methods. A sample of how to call...
Read more >Simple Java Program Example For Beginners - YouTube
Full Java Course: https://course.alexlorenlee.com/courses/learn- java -fastIf you want to be a Software Engineer, I HIGHLY RECOMMEND applying ...
Read more >Java - Sample Program - YouTube
Java - Sample Programwatch more videos at https://www.tutorialspoint.com/videotutorials/index.htmLecture By: Ms. Monica, Tutorials Point ...
Read more >Java Methods (With Examples)
A method is a block of code that performs a specific task. In this tutorial, we will learn to create and use methods...
Read more >Composition in Java Example
Composition allows creation of back-end class when it's needed, for example we can change Person getSalary method to initialize the Job object ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! I created the sample
I tested with
implementation 'com.github.dhaval2404:imagepicker:1.8'
and it works fine. I can chose image or take a photoWith you library when I tap on
ImageView
nothing to happenSampleImagePicker.zip
Thank you
v2.1.8 released.