Skip to content

the app works on emulator but not on real device.. any suggestion for troubleshooting? #2

@jfbdevs

Description

@jfbdevs

It works if I take a new photo using the camera, but if I try to select a photo from the gallery it won't display..
Any tips for troubleshooting? Thank you!


UPDATE

The problem was the image too big to fit into the imageView.
I actually solved scaling the image with this code:

int nh = (int) ( bitmap.getHeight() * (512.0 / bitmap.getWidth()) ); Bitmap scaled = Bitmap.createScaledBitmap(bitmap, 512, nh, true);

I guess it's a part you could add to the tutorial as many images in the gallery of modern phone will be quite big.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions