質問編集履歴
1
載せていたコードが誤っていたため、変更しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,89 +6,47 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
```
|
9
|
+
```xml
|
10
10
|
|
11
|
+
<?xml version="1.0" encoding="utf-8"?>
|
12
|
+
|
13
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
14
|
+
|
15
|
+
xmlns:tools="http://schemas.android.com/tools"
|
16
|
+
|
17
|
+
android:id="@+id/activity_main"
|
18
|
+
|
11
|
-
|
19
|
+
android:layout_width="fill_parent"
|
20
|
+
|
21
|
+
android:layout_height="fill_parent"
|
22
|
+
|
23
|
+
android:paddingBottom="@dimen/activity_vertical_margin"
|
24
|
+
|
25
|
+
android:paddingLeft="@dimen/activity_horizontal_margin"
|
26
|
+
|
27
|
+
android:paddingRight="@dimen/activity_horizontal_margin"
|
28
|
+
|
29
|
+
android:paddingTop="@dimen/activity_vertical_margin"
|
30
|
+
|
31
|
+
tools:context="com.example.nakao.koan.KOANWeb">
|
12
32
|
|
13
33
|
|
14
34
|
|
15
|
-
|
35
|
+
<WebView
|
16
36
|
|
37
|
+
android:layout_width="fill_parent"
|
17
38
|
|
39
|
+
android:layout_height="fill_parent"
|
18
40
|
|
19
|
-
|
41
|
+
android:layout_alignParentTop="true"
|
20
42
|
|
21
|
-
|
43
|
+
android:layout_alignParentLeft="true"
|
22
44
|
|
23
|
-
|
45
|
+
android:layout_alignParentStart="true"
|
24
46
|
|
25
|
-
|
47
|
+
android:id="@+id/webview" />
|
26
48
|
|
27
|
-
|
28
|
-
|
29
|
-
webView = (WebView) findViewById(R.id.webview);
|
30
|
-
|
31
|
-
webView.setWebViewClient(new LocalWebViewClient());
|
32
|
-
|
33
|
-
webView.getSettings().setJavaScriptEnabled(true);
|
34
|
-
|
35
|
-
webView.loadUrl("https:~");
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
public final class LocalWebViewClient extends WebViewClient {
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
@Override
|
48
|
-
|
49
|
-
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
50
|
-
|
51
|
-
super.onPageStarted(view, url, favicon);
|
52
|
-
|
53
|
-
|
49
|
+
</RelativeLayout>
|
54
|
-
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
@Override
|
60
|
-
|
61
|
-
public void onPageFinished(WebView view, String url) {
|
62
|
-
|
63
|
-
super.onPageFinished(view, url);
|
64
|
-
|
65
|
-
view.loadUrl(String.format(WriteJavaScript,"USER_ID","userid"));
|
66
|
-
|
67
|
-
view.loadUrl(String.format(WriteJavaScript,"USER_PASSWORD","userpassword"));
|
68
|
-
|
69
|
-
/* 読み込み終了 */
|
70
|
-
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
@Override
|
76
|
-
|
77
|
-
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
78
|
-
|
79
|
-
super.onReceivedError(view, errorCode, description, failingUrl);
|
80
|
-
|
81
|
-
/* 読み込み失敗 */
|
82
|
-
|
83
|
-
}
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
}
|
92
50
|
|
93
51
|
|
94
52
|
|