android - Adjusting to different screen sizes not working? -


i thought successful in adjusting different screen sizes(i using eclipse emulators , creating different screen sizes test app) when test app on actual devices result of app varies. example large screen size set emulator nexus s , work , fine, try on alcatel 1 touch fierce(real device) still considered large screen size app play little bit off, play on device considered large screen size app play emulator. guess mt question why? samble of how i'm checking different screen sizes below:

    displaymetrics displaymetrics = new displaymetrics();      getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics);      switch(displaymetrics.densitydpi)      {       case displaymetrics.density_low:          // layout small sized devices.          break;       case displaymetrics.density_medium:          // layout medium-sized devices.           break;       case displaymetrics.density_high:                     // layout large devices.          break;        case displaymetrics.density_xhigh:                       // layout large devices.         break;  

before case statement, try print density value this:

log.i("sushil", "displaymetrics.densitydpi : " + displaymetrics.densitydpi); 

and check if matches of defined case statement. else add new case statements, should work. few more defined cases :

displaymetrics.density_tv displaymetrics.density_xxhigh 

hope helps.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -