public class Main extends Activity {
8:
9: WebView mWebView;
10:
11: @Override
12: public void onCreate(Bundle savedInstanceState) {
13: super.onCreate(savedInstanceState);
14: setContentView(R.layout.main);
15:
16: mWebView = (WebView) findViewById(R.id.webview);
17:
18: String text = "<html><body>"
19: + "<p align=\"justify\">"
20: + "Your text in a block"
21: + "</p> "
22: + "</body></html>";
23:
24: mWebView.loadData(text, "text/html", "utf-8");
25: }
26: }
11: @Override
1: <?xml version="1.0" encoding="utf-8"?>
2: <RelativeLayout
3: xmlns:android="http://schemas.android.com/apk/res/android"
4: android:layout_width="fill_parent"
5: android:layout_height="fill_parent">
6: <WebView
7: android:id="@+id/webview"
8: android:layout_width="fill_parent"
9: android:layout_height="fill_parent" />
10: </RelativeLayout>
标签:11,text,align,savedInstanceState,mWebView,WebView,onCreate,分本
From: https://blog.51cto.com/u_16166892/6528213