I know about gallery view is outdated, but i still need it.
I've tested it on Nexus 7, Samsung S4, LG phones and it works fine, but on HTC phone I got blank place instead some images in Gallery, like this:
Here is a sample of code:
<Gallery
android:layout_marginTop="5dp"
android:id="@+id/gallery1"
android:layout_width="match_parent"
android:layout_height="350dp" />
class ImageAdapter extends BaseAdapter {
@Override
public int getCount() {
return images.size();
}
@Override
public Object getItem(int arg0) {
return null;
}
@Override
public long getItemId(int arg0) {
return 0;
}
@Override
public View getView(int position, View view, ViewGroup vg) {
ImageView image = new ImageView(getApplicationContext());
image.setImageResource(images.get(position));
image.setPadding(20, 20, 20, 20);
image.setLayoutParams(new Gallery.LayoutParams(550, 450));
image.setScaleType(ImageView.ScaleType.FIT_XY);
return image;
}
}
what is wrong with it?