1. Download our Official Android App: Forums for Android!

Apps About dynamic slider

Discussion in 'Android Development' started by simple80, Sep 25, 2012.

  1. simple80

    simple80 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Sep 23, 2012

    Sep 23, 2012
    3
    0
    5
    Hello,

    I used a sample code is reading images from R.java file. I want to change it as display from web. But it has an error. Because i sent parameter is drawable but it must be Integer. How do i it?

    Current Code


    PHP:
    1.                              image_prev = (ImageView)findViewById(R.id.image_prev);
    2.         image_centre = (ImageView)findViewById(R.id.image_centre);
    3.         image_next = (ImageView)findViewById(R.id.image_next);
    4.          
    5.         image_res_ids = new ArrayList<Integer>();
    6.         image_res_ids.add(R.drawable.zero);
    7.         image_res_ids.add(R.drawable.one);
    8.         image_res_ids.add(R.drawable.two);
    9.         image_res_ids.add(R.drawable.three);
    10.         image_res_ids.add(R.drawable.four);


    i want to change with this


    PHP:
    1.                        image_prev = (ImageView)findViewById(R.id.image_prev);
    2.         image_centre = (ImageView)findViewById(R.id.image_centre);
    3.         image_next = (ImageView)findViewById(R.id.image_next);
    4.         image_res_ids = new ArrayList<Integer>();
    5.        Drawable image = loadImageFromURL("http://dedededede.com/image.png"));
    6.        image_res_ids.add(image);  
    7.                


    example is here
     

    Advertisement

Share This Page

Loading...