1. Are you ready for the Galaxy S20? Here is everything we know so far!

Displaying images conditionally

Discussion in 'Android Development' started by Negrazo1949, Dec 24, 2020.

  1. Negrazo1949

    Negrazo1949 Lurker
    Thread Starter

    I am a new guy in this Android world.

    In a new app, I read 3 fields from a bunch of rows from a Sqlite DB.

    One of this fields is called “path” and I need it in the SecondActivity.

    The name of the table is “sections”.



    Select * from sections order by name;



    This gives me a ListView in the MainActivity, from it I can select one row.

    What I need is the following:



    1.- To send the selected “path” to the SecondActivity.

    2.- This field “path” can have only three possible values, 1,2 or 3.

    Now based on this value,



    if path = 1 =====> I must display image1.png

    if path = 2 =====> I must display image2.png

    if path = 3 =====> I must display image3.png



    Any ideas or some examples to help me???

    Thank you in advance.



    Sincerely,

    Rafael
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...