开发者

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

开发者 https://www.devze.com 2023-03-04 07:10 出处:网络
How do I open up browser window within my activity.Ideally I would like them to stay inside my app with some type of em开发者_如何学Gobedded webkit activity view?How can this be done?If I understood c

How do I open up browser window within my activity. Ideally I would like them to stay inside my app with some type of em开发者_如何学Gobedded webkit activity view? How can this be done?


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


This could help you: http://mobile.tutsplus.com/tutorials/android/android-sdk-embed-a-webview-with-the-webkit-engine/ ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消