what is weatherDataCollection in this code

Quickly share your Android Code Snippets here...

what is weatherDataCollection in this code

Postby amita » Fri Jul 26, 2013 12:38 pm


View vi=convertView;
if(convertView==null){

vi = inflater.inflate(R.layout.list_row, null);
holder = new ViewHolder();

holder.tvCity = (TextView)vi.findViewById(R.id.tvCity); // city name
holder.tvWeather = (TextView)vi.findViewById(R.id.tvCondition); // weather
holder.tvTemperature = (TextView)vi.findViewById(R.id.tvTemp); // city temperature
holder.tvWeatherImage =(ImageView)vi.findViewById(R.id.list_image); // thumb image

vi.setTag(holder);
}
else{
holder = (ViewHolder)vi.getTag();
}

// Setting all values in listview

holder.tvCity.setText(weatherDataCollection.get(position).get(KEY_CITY));
holder.tvWeather.setText(weatherDataCollection.get(position).get(KEY_CONDN));
holder.tvTemperature.setText(weatherDataCollection.get(position).get(KEY_TEMP_C));

//Setting an image
String uri = "drawable/"+ weatherDataCollection.get(position).get(KEY_ICON);
int imageResource = vi.getContext().getApplicationContext().getResources().getIdentifier(
uri, null, vi.getContext().getApplicationContext().getPackageName());
Drawable image = vi.getContext().getResources().getDrawable(imageResource);
holder.tvWeatherImage.setImageDrawable(image);[code][/code]
amita
Freshman
Freshman
 
Posts: 2
Joined: Thu Jul 18, 2013 11:13 am

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 2 guests