Hi I am using a customized android listview with custom arrayadapter from a tutorial on this website for my application.
http://www.ezzylearning.com/tutorial.aspx?tid=1763429
In the MainActivity.java they have:
Weather weather_data[] = new Weather[]
{
new Weather(R.drawable.weather_cloudy, "Cloudy"),
new Weather(R.drawable.weather_showers, "Showers"),
new Weather(R.drawable.weather_snow, "Snow"),
new Weather(R.drawable.weather_storm, "Storm"),
new Weather(R.drawable.weather_sunny, "Sunny")
};
What I want to do is retrieve images from the web such as http://spe.atdmt.com/ds/NMMRTSMGUWDS/121114_reddit/Win8_wiki_728x90_v2.jpg
and use it instead of R.drawable.*
I have tried converting a URL link to a Bitmap image then changing a couple lines of code in
Weather.java:
from public int icon; to public Bitmap icon;
and
from public Weather(int icon, String title) to public Weather(Bitmap icon, String title)
WeatherAdapter.java:
from holder.imgIcon.setImageResource(weather.icon); to holder.imgIcon.setImageBitmap(weather.icon);
I must not totally understand the code. I hope someone can help me out here. Thank you