About dynamic slider

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

About dynamic slider

Postby simple80 » Tue Sep 25, 2012 6:03 pm

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

Code: Select all
image_prev = (ImageView)findViewById(R.id.image_prev);
        image_centre = (ImageView)findViewById(R.id.image_centre);
        image_next = (ImageView)findViewById(R.id.image_next);
       
        image_res_ids = new ArrayList<Integer>();
        image_res_ids.add(R.drawable.zero);
        image_res_ids.add(R.drawable.one);
        image_res_ids.add(R.drawable.two);
        image_res_ids.add(R.drawable.three);
        image_res_ids.add(R.drawable.four);



i want to change with

Code: Select all
image_prev = (ImageView)findViewById(R.id.image_prev);
        image_centre = (ImageView)findViewById(R.id.image_centre);
        image_next = (ImageView)findViewById(R.id.image_next);
        image_res_ids = new ArrayList<Integer>();
       Drawable image = loadImageFromURL("http://dedededede.com/image.png"));
       image_res_ids.add(image);



example is here: https://github.com/aveyD/Dynamic-Paging-Demo
simple80
Freshman
Freshman
 
Posts: 2
Joined: Sun Sep 23, 2012 9:10 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests