N
N
Nikita Sklyuev2012-07-01 21:13:45
Java
Nikita Sklyuev, 2012-07-01 21:13:45

How to make a link in android application?

Good evening dear habrchane.
The question is how to make a link from a button, image, or textView element in android?
So that when you click on this link, you will go to the browser!?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
meannano, 2012-07-01
@meandnano

Add a start activity to your button click handler with a special intent containing your link. Like this:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mylink.com"));
startActivity(browserIntent);

A
ara89, 2012-07-01
@ara89

for TextView you can add xml attribute android:autoLink="web"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question