android screen size value weird behaviour -


i making apps has custom camera feature. right now, in xml have framelayout under root layout match parent value both it's width , height. prepare camera , set height accordingly. add camera view inside framelayout.

but when screen size value, height exact, return different value screen's size actual height value. device evercross 1 x (should 854 x 480 pixels), can see screen size here.

but when height via code:

    displaymetrics displaymetrics = new displaymetrics();     ((activity) mcontext).getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics);     int width = displaymetrics.widthpixels;     int height = displaymetrics.heightpixels; 

it returns value of 782 x 480 pixels. notice 782 rather 854. , oddly, when hard-coded value 854 , set camera size 854, still doesn't become full screen , still give white space 20-30 pixels. have idea how went wrong?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -