android - Get dimension of screen area used by activity -


how determine dimensions (width , height) of activity during oncreate. dimension must not of entire screen of area used activity. few methods tried posted on end giving device's maximum screen sizes.

have tried (not oncreate):

activityrootview = findviewbyid(r.id.yourrootview);             activityrootview.getviewtreeobserver().addongloballayoutlistener(new ongloballayoutlistener() {             @override             public void ongloballayout() {                    //activityrootview.getheight();                    //...                 }              }         }); 

and ofcourse, activitys main layout has match parent or fill content


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -