0
0

More than 3 years have passed since last update.

【Kotlin 初心者】IntentでWebUrlにと遷移する方法

Posted at

KotlinでWebUrlに遷移する方法について

Intentと同じ要領でurlをパースして上がればいけますね

実装

MainActiviy.kt

        viewBinding.button.setOnClickListener {
            val context = viewBinding.root.context

            Intent(Intent.ACTION_VIEW).also {
                val url = "https://www.google.co.jp"
                it.data = Uri.parse(url)
                context.startActivity(it)
            }
        }

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0