john
john

Reputation: 1282

android application in fixed size window

is it possible to run an android application in a fixed size window?

for example , i want to run my application in a fixed size window and at the same time i should be able to control the remaining area of the device screen(read messages, play music, ect..).

Upvotes: 3

Views: 1159

Answers (1)

MKJParekh
MKJParekh

Reputation: 34301

I think..

you can use following in all your activity to show at specific gravity(left/right/top/bottom) and Layout(hight/width) of the activity in OnCreate() method.

    getWindow().setGravity(gravity); 
    getWindow().setLayout(width, height); 
    getWindow().setAttributes(a); 

More you can here in DeveloperSite

This is how I used , android.view.WindowManager.LayoutParams WMLP = getWindow().getAttributes();

     WMLP.height =100;    
     WMLP.width = 100;                
     getWindow().setAttributes(WMLP);  
     getWindow().setGravity(Gravity.BOTTOM); 

Upvotes: 4

Related Questions