I am trying to show in a listview in android some images that I have in a database and this part
@Override
public View getView (int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater ();
View listViewItem = inflater.inflate (R.layout.layout, null, true);
TextView androids = (TextView) listViewItem.findViewById (R.id.tvandroidosnames);
// TextView textView = (TextView) listViewItem.findViewById (R.id.tvurl);
// textView.setText (urls [position]);
androidos.setText (androidosnames [position]);
ImageView image = (ImageView) listViewItem.findViewById (R.id.imgvw);
image.setImageBitmap (Bitmap.createScaledBitmap (bitmaps [position], 100, 50, false));
return listViewItem;
}
It gives me the following error:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth ()' on a null object reference