Last active
July 3, 2019 04:08
-
-
Save IhwanID/edcf193929e2129cc1cf6b084080ebc1 to your computer and use it in GitHub Desktop.
webview class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <WebView xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@+id/webView" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent"> | |
| </WebView> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WebViewActivity : Activity() { | |
| @SuppressLint("SetJavaScriptEnabled") | |
| public override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_webview) | |
| val webView = findViewById<WebView>(R.id.webView) | |
| webView.settings.javaScriptEnabled = true | |
| webView.loadUrl(intent.getStringExtra("url")) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment