实现文本链接其中tv是TextView类型的控件。只需写java代码即可实现链接,无需在xml文件中进行其他的设置。SpannableStringspanTxt=newSpannableString("欢迎访问我的博客——Killerlegend的博客……"); spanTxt.setSpan(newURLSpan("http://www.cnblogs.com/killerlegend/"),0,spanTxt.length(),Spannable.SPAN_INCLUSIVE_EXCLUSIVE); tv.append("\n"+ Read More
//发短信 classSendMsgClickListenerimplementsOnClickListener{ publicvoidonClick(Viewv){ //调用Android系统API发送短信 Uriuri=Uri.parse("smsto:10086"); Intentintent=newIntent(Intent.ACTION_SENDTO,uri); intent.putExtra("sms_body","android..."); startActivity(intent); } } //打电话 classSe Read More
下面来简要的说一下Android开发中如何对某一个Activity进行背景色的设置。下面我以名字为FirstActivity的Activity的背景色的设置进行说明,先说一下Drawable类:关于Drawable:A Drawable is a general abstraction for "something that can be drawn." Most often you will deal with Drawable as the type of resource retrieved for drawing things to the screen; the Read More
URN与URL隶属于URI,三者的意思分别如下:URI:Uniform Resource Identify【统一资源标识符】URL:Uniform Resource Location【统一资源定位符】URN:Uniform Resource Name【统一资源名称】1:URI一般有三部分组成:访问资源的命名机制。存放资源的主机名。资源自身的名称,由路径表示。基本格式:[scheme:]schemeSpecificPart/[path][#anchor]注:其中scheme事先已经规定好,具体可以引用,后面加之以冒号与schemeSpecificPart隔开,再加上“/”,跟上路径。如果URI指 Read More