How to open a website when a Button is clicked in Android application?

前端 未结 10 2080
囚心锁ツ
囚心锁ツ 2020-12-01 00:23

I am designing an app, with several button for users to click on. Once button is clicked, user is directed to appropriate website. How do I accomplish this?

10条回答
  •  臣服心动
    2020-12-01 00:46

    I just need one line to show a website in my app:

    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://match4app.com")));
    

提交回复
热议问题