-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathWebView
41 lines (31 loc) · 935 Bytes
/
WebView
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Abstract of code by @akenaton
// Do not forget the INTERNET permission
import android.webkit.WebViewClient;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.view.ViewGroup;
import android.app.Activity;
import android.widget.RelativeLayout;
import android.widget.FrameLayout;
FrameLayout fl;
Activity act;
WebView web;
WebViewClient wbc;
void settings(){
fullScreen();
}
public void onStart() {
super.onStart();
act = this.getActivity();
wbc = new WebViewClient();
web = new WebView(act);
web.setLayoutParams(new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
web.setWebViewClient(wbc);
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl("http:www.google.com/");
fl = (FrameLayout)act.getWindow().getDecorView().getRootView();
fl.addView(web);
}
void setup(){
background(255);
}