-
Notifications
You must be signed in to change notification settings - Fork 0
/
webview.pde
43 lines (37 loc) · 1.05 KB
/
webview.pde
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
42
43
import android.content.res.AssetManager;
import android.webkit.WebViewClient;
import android.os.Looper;
import android.content.Context;
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;
import java.io.File;
import android.os.Bundle;
import android.os.Environment;
FrameLayout fl;
Activity act;
WebView web;
Context context;
WebViewClient wbc;
File[] files;
String[] filesPath;
public void onStart() {
super.onStart();
act = this.getActivity();
wbc = new WebViewClient();
web = new WebView(act);
web.setLayoutParams(new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
web.setWebViewClient(wbc);
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl("data/dead-leaves.html");
fl = (FrameLayout)act.getWindow().getDecorView().getRootView();
fl.addView(web);
};
void setup() {
background(255, 0, 0);
};
void draw() {
};