question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use on Java. Could you give some sample

See original GitHub issue

Hi! 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:closed
  • Created 2 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
ioviovcommented, May 11, 2021

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 photo

With you library when I tap on ImageView nothing to happen

SampleImagePicker.zip

Thank you

0reactions
Drjackycommented, May 11, 2021

v2.1.8 released.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found