【发布时间】:2014-12-11 13:32:40
【问题描述】:
我是 android 开发新手.. 我只有一个这样的文本视图
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:autoLink="web"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
然后我为 textview 设置 settext 像
<string name="content_ontheroad">Check road conditions on your route before you leave.\nEach state or territory has a different phone number and\nwebsite detailing relevant information, or ask a local.\n\n
\u2022   ACT 13 22 81\n
<a href="http://www.tams.act.gov.au/roads-transport">    http://www.tams.act.gov.au/roads-transport</a> \n\n
\u2022   N SW 13 27 01\n
<a href="https://www.livetraffic.com">    https://www.livetraffic.com</a> \n\n
\u2022   Northern Territory 1800 246 199 or\n <a href="http://www.securent.nt.gov.au/">    http://www.securent.nt.gov.au/</a>\n\n
\u2022   Queensland 13 19 40 or\n <a href="http://www.racq.com.au/roadconditions">    http://www.racq.com.au/roadconditions</a>\n\n
\u2022   South Australia 1300 361 033 or\n
<a href="http://www.dpti.sa.gov.au/OutbackRoads">    http://www.dpti.sa.gov.au/OutbackRoads</a>\n\n
\u2022   Tasmania 1300 135 513 or\n <a href="http://www.dier.tas.gov.au/road_closures_and_delays">    http://www.dier.tas.gov.au/road_closures_and_delays</a>\n\n
\u2022   Victoria, 13 11 70 or\n <a href="http://www.vicroads.vic.gov.au">    http://www.vicroads.vic.gov.au</a>\n\n
\u2022   Western Australia 1800 013 314 or\n<a href="https://www.mainroads.wa.gov.au/UsingRoads/RoadTrafficInformation/Pages/RoadTrafficInformation.aspx">    https://www.mainroads.wa.gov.au/UsingRoads/RoadTrafficInformation/Pages/RoadTrafficInformation.aspx</a> \n\n
On country roads, always keep alert for wildlife, particularly\n at dawn or dusk when animals may be active. Be cautious,\n scanning both the road ahead and the roadsides. Be\n aware of traffic behind you, as well as oncoming traffic.\n\n
When safe to do so, use your high beam headlights so that\n you can see further when driving at night. However, bright\n lights can dazzle animals and rather than move off the\n road, they may remain stationery and in the path of your\n vehicle.\n\n
When travelling at speed, do not swerve to avoid hitting an\n animal, as this could put you and other motorists in danger.\n Sometimes, it may be impossible to avoid a collision with\n an animal.\n\n
More information:\n\n<a href="http://www.racv.com.au/wps/wcm/connect/racv/Internet/Primary/travel/before+you+go/driving+tips">http://www.racv.com.au/wps/wcm/connect/racv/Internet/Primary/travel/before+you+go/driving+tips</a></string>
它有不止一个链接。我启用自动链接到 textview 以在默认浏览器中打开链接。 但我需要在我的应用程序中的 webview 中打开它
【问题讨论】:
-
@DivyanshGoenka 当我点击 textview 时,我需要获取 url