barcodereader
barcodereader

Reputation: 2038

Android How to open up a browser window from an activity with URL?

How do I open up browser window within my activity. Ideally I would like them to stay inside my app with some type of embedded webkit activity view? How can this be done?

Upvotes: 0

Views: 893

Answers (3)

dmon
dmon

Reputation: 30168

Hmmm if you just want to present the link inside a TextView, you can use a span to make the links clickable (it will be handled with the browser, clicking back will go back to the activity that contains the link):

  URLSpan span = new URLSpan(url);
  textView.getText().setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

If you're rendering content with links, you might want to look into the Linkfy class.

Upvotes: 0

Andrei Sfat
Andrei Sfat

Reputation: 8606

If I understood correctly, you can use Web View
Here you can find a tutorial on doing that.

Upvotes: 2

Related Questions