I am using the following code to load an image in Android Pager, but I get a blank area instead of an image, and when I load text then I get an output.
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View vi=container;
//if(container==null)
vi = inflater.inflate(R.layout.fragment_pager_list, null);
TextView title = (TextView)vi.findViewById(R.id.textTitle); // title
ImageView thumb_image=(ImageView)vi.findViewById(R.id.imageProduct);
// thumb image
HashMap<String, String> song = new HashMap<String, String>();
song = ListProduct.productList.get(mNum);
// Setting all values in listview
title.setText(song.get(ListProduct.KEY_TITLE));
Bitmap bitmap = BitmapFactory.decodeFile
(song.get(ListProduct.KEY_THUMB_URL));
thumb_image.setImageBitmap(bitmap);
return vi;
}
Above code I m using but I m not getting where I am wrong. Please help me.