About dynamic slider


Last Updated: 2012-09-25 16:59:41
  1. simple80

    simple80 New Member

    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