一、android里TextView加下划线的几种方式
如果是在资源文件里:
如果是在资源文件里:
<resources>
<string name="hello"><u>phone:0123456</u></string>
<string name="app_name">MyLink</string>
</resources><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"> </span>
如果是代码里:
TextView textView = (TextView)findViewById(R.id.tv_test);
textView.setText(Html.fromHtml("<u>"+"0123456"+"</u>"));
代码也可以这样:
tvTest.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线
tvTest.getPaint().setAntiAlias(true);//抗锯齿
二、利用intent跳转到一个网页(在浏览器中打开)
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com"));
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);