When I use layoutInflater in android to create custom layout in list then at the declaration of LayoutInflater
give an error unreachable statement . How fix it
public View getView(int position, View convertView, ViewGroup parent) {
return super.getView(position, convertView, parent);
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View vw = inflater.inflate(R.layout.list_custom , parent,false);
Tour tour = tours.get(position);
TextView tv =(TextView) vw.findViewById(R.id.texttile);
tv.setText(tour.getTitle());
tv =(TextView) vw.findViewById(R.id.price);
NumberFormat nf= NumberFormat.getCurrencyInstance();
tv.setText(nf.format(tour.getPrice()));
ImageView iv =(ImageView) vw.findViewById(R.id.imageview);
int imageResource = context.getResources().getIdentifier(tour.getImage() , "drawable" , context.getPackageName());
if (imageResource!=0){
iv.setImageResource(imageResource);
}
return vw;
}
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
says unreachble statement