I have read http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/reference/android/util/DisplayMetrics.html and I somehow left with a gap here.
- How is the transition from
DisplayMetrics.densityDpito for exampleString ("ldpi")done? - And more importantly from
DisplayMetrics.widthPixelsandDisplayMetrics.widthPixelsto for exampleString ("large")
For the first I can whip up a switch statement easy enough. But the 2nd one is quite more complex. Does anybody know any details? Is there a function which does it?
I even searched the source and did not find anything. But maybe i looked for the wrong thing.
I figured it out, here the correct code (you need a valid
android.content.Contextinstance in attributecontext):