Created
July 2, 2020 09:42
-
-
Save basith374/59baf300fd374ef056a630a5bc67e124 to your computer and use it in GitHub Desktop.
android webview splash
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
| import kotlinx.android.synthetic.main.activity_main.webview; | |
| import kotlinx.android.synthetic.main.activity_main.splash; | |
| class MainActivity : Activity() { | |
| private class MyWebViewClient() : WebViewClient() { | |
| override fun onPageFinished(view: WebView?, url: String?) { | |
| super.onPageFinished(view, url) | |
| splash.setVisibility(View.INVISIBLE); // can't call function on this reference | |
| } | |
| } | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| webview.webViewClient = MyWebViewClient() | |
| webview.loadUrl("https://example.com") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment