天天看点

android跳转之短信浏览器拨打电话界面

Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:1555656****"));
	intent.putExtra("sms_body", "编辑短信内容 !!");
	startActivity(intent);

     这段代码简单明了,需要用到的朋友一试便知。号码跟内容就不用备注了.
           
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.******.com"));
			startActivity(intent);
			//浏览器也是这么简单,一个网址搞定,就不多讲了,玩这个的人讲究的是实用
           
Intent intent = new Intent(Intent.ACTION_DIAL);
			intent.setData(Uri.parse("tel:187*****750"));
			intent.addCategory(Intent.CATEGORY_DEFAULT);
			startActivity(intent);
           

从此打电话也不再是难题

Intent intent = new Intent();
			intent.setAction("android.intent.action.CALL_BUTTON");
			startActivity(intent);
           

此代码一样可以打电话,就是无法把号码传过去

Intent intent = new Intent();
			intent.setComponent(new ComponentName("com.chengxl.demo",
					"com.chengxl.demo.IntentDemo"));
			intent.putExtra("str", "大米");
			startActivity(intent);
           

跳转到自己的程序,两个参数,前一个是包名,后一个是主activity的名。加个一个信息来知道是跳转了。