yonilx
yonilx

Reputation: 165

android: set WebView to (real) full screen

I'm trying to make my WebView fullscreen by standard, i know how to stretch it to "full screen" but what I'm trying to do is to create the full screen you get when you long click the WebView and choose the full screen option. does anyone knows how to do that ?

edit: What I mean is how to enter "Full Screen Mode" which is in option in WebView when you long click it.

Upvotes: 3

Views: 16722

Answers (2)

Harsh Trivedi
Harsh Trivedi

Reputation: 1010

you have to change height and width of web view programmatically to fill parent.i think you can change it by onclick listener of web view. for reference Click here

Upvotes: 0

Yugandhar Babu
Yugandhar Babu

Reputation: 10349

If you want to hide status bar and title bar use below code

in java file

requestWindowFeature(Window.FEATURE_NO_TITLE); 
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 

in manifest file

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

or if you want to resize the webview according to your actions use below code in your action listener

    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
    webview.setLayoutParams(params);

try the above, it may help you.

Upvotes: 6

Related Questions