How to load an image from internal memory and use it on a imageview on Huawei?

Hi, I have a Huawei P8 Lite with EMUI 4.1 (Android 6) that it's not loading images from external storage.
I've tried with BitmapFactory DecodeFile() method, with Java.IO.FILE and then, get the Uri to set it to imageview and imageview remains empty always.

If I just do an intent to open this image with gallery, it show the image correctly.

What I'm doing wrong? Any advice?

Answers

  • Ahsan_SiddiqueAhsan_Siddique PKMember ✭✭✭✭

    Simply use Media plugin and solve your problem.

  • MillanesMillanes ESMember

    What Media plugin? Can you specify the nugget package?

  • seanydaseanyda GBMember ✭✭✭✭✭

    @Millanes said:
    What Media plugin? Can you specify the nugget package?

    This one:
    https://github.com/jamesmontemagno/MediaPlugin
    https://www.nuget.org/packages/Xam.Plugin.Media

  • MillanesMillanes ESMember

    With that plugin, i can't manage to load an image from a concrete directory.
    The CrossMedia.Current.PickPhotoAsync() method only opens the file from default gallery path. And I need to open from application external data folder.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @Millanes said:
    Hi, I have a Huawei P8 Lite with EMUI 4.1 (Android 6) that it's not loading images from external storage.
    I've tried with BitmapFactory DecodeFile() method, with Java.IO.FILE and then, get the Uri to set it to imageview and imageview remains empty always.

    If I just do an intent to open this image with gallery, it show the image correctly.

    What I'm doing wrong? Any advice?

    How about some sample code that you are using, including the path that you are loading the image from?

    Are you getting any error or just that the image view remains blank?

Sign In or Register to comment.