1 |
|
package com.choibean.android.hangeulider; |
2 |
|
|
3 |
|
import java.io.IOException; |
4 |
|
import java.io.InputStream; |
5 |
|
|
6 |
|
import android.app.Activity; |
7 |
|
import android.content.res.Resources; |
8 |
|
import android.os.Bundle; |
9 |
|
import android.webkit.WebView; |
10 |
|
|
|
|
| 73,1% |
Uncovered Elements: 7 (26) |
Complexity: 5 |
Complexity Density: 0,23 |
|
11 |
|
public class HelpActivity extends Activity { |
12 |
|
CharSequence message; |
13 |
|
final String mimeType = "text/html"; |
14 |
|
final String encoding = "utf-8"; |
15 |
|
|
|
|
| 85,7% |
Uncovered Elements: 3 (21) |
Complexity: 4 |
Complexity Density: 0,21 |
|
16 |
4
|
@Override... |
17 |
|
protected void onCreate(Bundle savedInstanceState) { |
18 |
4
|
super.onCreate(savedInstanceState); |
19 |
4
|
setContentView(R.layout.help); |
20 |
|
|
21 |
4
|
byte[] b; |
22 |
4
|
char[] c; |
23 |
4
|
String text = ""; |
24 |
4
|
try { |
25 |
4
|
InputStream is = this.getResources().openRawResource(R.raw.help); |
26 |
4
|
b = new byte[is.available()]; |
27 |
4
|
c = new char[is.available()]; |
28 |
4
|
is.read(b); |
29 |
13516
|
for (int i = 0; i < b.length; i++) { |
30 |
13512
|
c[i] = (char) b[i]; |
31 |
|
} |
32 |
4
|
text = String.valueOf(c); |
33 |
4
|
is.close(); |
34 |
|
} catch (IOException e) { |
35 |
0
|
Hangeulider.logD("io", "trying to open raw help file"); |
36 |
|
} catch (Resources.NotFoundException e) { |
37 |
0
|
Hangeulider.logD("io", e.toString()); |
38 |
0
|
Hangeulider.logD("io", e.getMessage()); |
39 |
|
} |
40 |
4
|
WebView wv = (WebView) findViewById(R.id.webview1); |
41 |
4
|
wv.loadDataWithBaseURL(null, text, "text/html", "utf-8", "about:blank"); |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
44 |
0
|
protected void loadView(int id, String text) {... |
45 |
0
|
WebView wv; |
46 |
0
|
wv = (WebView) findViewById(id); |
47 |
0
|
wv.loadData(text, mimeType, encoding); |
48 |
|
} |
49 |
|
} |