i created project show images carousel view.when run project in many devices. when tested in nexus phone images sizes show in small. big problem in project. pls tell me way on come problem...
thanks
i not put copies of images in mdpi, hdpi, xhdpi etc because have far many images approach , apk size large. (incidentally, old phones use ldpi).
instead place images in mdpi , enlarge them tablets (e.g. this):
if (istablet(getactivity())){ // tablets debuglog( "display tablet image="+imagename); int resid = getresources().getidentifier(imagename,"drawable", getactivity().getpackagename()); // corresponding resource id if (resid != 0) { bitmap bmp=bitmapfactory.decoderesource(getresources(), resid); int width=480; int height=300; bitmap resizedbitmap=bitmap.createscaledbitmap(bmp, width, height, true); imageview imageview = (imageview) getactivity().findviewbyid(r.id.tablet_image); // imageview change //imageview.setimageresource(resid); imageview.setimagebitmap(resizedbitmap); } }
Comments
Post a Comment