How can I open an image by the gallery?

Discussion in 'Android Questions' started by rickrack, Oct 25, 2012.

  1. rickrack

    rickrack Member Licensed User

    Hi again :D
    How can I open, with the default gallery, an image saved on the sd card?
    I don't know how to explain you in english so here's an example of what I mean: Pseudocode:
    Open Gallery(file dir, file name


    Thanks in advance for your help,
    if you didn't understand please write it, I'll try to explain it in a better way :)
     
  2. NJDude

    NJDude Expert Licensed User

    You can open the gallery with this code:
    Code:
    Dim i As Intent
                
    i.Initialize(i.ACTION_PICK, 
    "")
    i.SetType(
    "image/*")
                
    StartActivity(i)
     
    hidhu and yiankos1 like this.
  3. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Or to view a known file:

    Code:
    Dim i As Intent 
       i.Initialize(i.ACTION_VIEW, 
    "file://" & EncodeUrl(FilePath))
       i.SetType(
    "image/*")
       
    StartActivity(i)
    Implement EncodeURL via StringUtils.
     
    NJDude likes this.
  4. rickrack

    rickrack Member Licensed User

    Thanks thedesolatesoul, I'll try it and inform you :)
     
  5. rickrack

    rickrack Member Licensed User

    It works fine!! Thank you!! :))
     
  6. arnold steger

    arnold steger Member Licensed User

    can also use for open my folder whit all my images.
    would like at click open my folder (/storage/sdcard0/ImagePrivate/) and view minimized all images and at click of a image view fullscreen?
    code from post #3 not work (massage:Image not found)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice