diff --git a/apk/src/app/example/ExampleApp.java b/apk/src/app/example/ExampleApp.java index 9174a0c..998d44a 100644 --- a/apk/src/app/example/ExampleApp.java +++ b/apk/src/app/example/ExampleApp.java @@ -8,26 +8,22 @@ import android.text.method.ScrollingMovementMethod; import android.view.MenuItem; import android.view.*; import android.widget.*; +import android.webkit.WebView; +import android.webkit.*; import android.view.ViewGroup.*; +import android.util.Base64; public class ExampleApp extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // creating LinearLayout - LinearLayout linLayout = new LinearLayout(this); - // specifying vertical orientation - linLayout.setOrientation(LinearLayout.VERTICAL); - // creating LayoutParams - LayoutParams linLayoutParam = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); - // set LinearLayout as a root element of the screen - setContentView(linLayout, linLayoutParam); - - LayoutParams lpView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); - - TextView tv = new TextView(this); - tv.setText("SUPERVIEalexW"); - tv.setLayoutParams(lpView); - linLayout.addView(tv); + WebView myWebView = new WebView(this);//activityContext); + WebViewClient myWebViewClient= new WebViewClient(); + myWebView.setWebViewClient(myWebViewClient); + String unencodedHtml = "

this is html

this is a h2

"; + String encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(),Base64.NO_PADDING); + myWebView.loadData(encodedHtml, "text/html", "base64"); + //myWebView.loadUrl("https://alexmahr.de/ru"); + setContentView(myWebView); } }