Android setBackgroundResource doesn't use image depend on dpi -


i wan't use setbackgroundresource method set image button.

i have different folders same button in different dpi's when set button code uses drawable folder instead of correct folder

resume.setbackgroundresource(r.drawable.resumegrey); 

folders

the resumegrey copied in right folders diffrent dpi's

displaymetrics metrics = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(metrics); float density = metrics.density; 

density float , value changed per screen size...

so,if have

240*320 density 0.5 320*480 density 1.0 480*800 density 1.5 

and set size using density , img.setmaxheight(density*100);

and put multiple screen supports in manifest file.multiple screen support


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -