Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- findViewById<Button>(R.id.btnWeb).setOnClickListener {
- startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://www.ya.ru")))
- }
- }
- }
- class Browser : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_browser)
- val webView = findViewById<WebView>(R.id.webView)
- webView.webViewClient = WebViewClient()
- val data: Uri? = intent.data
- webView.loadUrl(data.toString())
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement