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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
you can use this on your button click activity
and import this on your code
I just need one line to show a website in my app:
Add this to your button's click listener:
If you have a website url as a variable instead of hardcoded string then don't forget to handle an ActivityNotFoundException and show error. Or you may receive invalid url and app will simply crash. (Pass random string instead of
url
variable and see for youself )If you are talking about an RCP app, then what you need is the SWT
link
widget.Here is the official link event handler snippet.
Update
Here is minimalist android application to connect to either superuser or stackoverflow with 2 buttons.
And here is the layout.
Time permitting, I'll add the site logos to the buttons to make it a bit sexier ;-)
You can wrap the buttons in anchors that href to the appropriate website.
When the user clicks the button (input) they are directed to the destination specified in the href property of the anchor.
Edit: Oops, I didn't read "Eclipse" in the question title. My mistake.