android 之Intent的使用

来源:互联网 发布:sql union sum 编辑:程序博客网 时间:2024/06/06 11:36

下面列出几种Intent的用法 :
1.显示网页:

Uri uri = Uri.parse( "http://www.google.com");   Intent it  = new  Intent(Intent.ACTION_VIEW,uri);  startActivity(it);  
2.显示地图:
Uri uri = Uri.parse( "geo:38.899533,-77.036476" );  Intent it = new  Intent(Intent.Action_VIEW,uri);  startActivity(it);  
3.路径规划:
Uri uri=Uri.parse("http://maps.google.com/mapsf=d&
saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");   
Intent it = new  Intent(Intent.ACTION_VIEW,URI);    startActivity(it);  
4.拨打电话: 
Uri uri = Uri.parse("tel:xxxxxx");  Intent it = new Intent(Intent.ACTION_DIAL, uri);    startActivity(it);  
5.发送Email
Uri uri = Uri.parse("mailto:xxx@abc.com");  Intent it = new Intent(Intent.ACTION_SENDTO, uri);  startActivity(it);  



0 0