歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android應用中可以調用的系統Activity

Android應用中可以調用的系統Activity

日期:2017/3/1 9:51:39   编辑:Linux編程

Android系統內置了多個公共的activity,其他應用可以很方便的調用這些activity,而不用自己去實現。幾次都用到了這部分知識,現在總結一些,方便以後參考。

1、撥號界面:

Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:123456789"));

startActivity(callIntent);

2、將電話號傳入到撥號程序

Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123456789"));

startActivity(dialIntent);

3、調用撥號程序

Intent touchDialerIntent = new Intent(“coom.android.hone.action.TOUCH_DIALER”);

startActivity(touchDialerIntent);

4、浏覽網頁

Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.linuxidc.com"));

startActivity(webIntent);

5、向email客戶端傳遞地址

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:[email protected]"));

startActivity(emailIntent);

6、還可以直接將郵件內容發送到郵件客戶端,暫時沒用到

7、查看聯系人

Intent contactIntent = new Intent(“com.android.cantacts.action.LIST_CONTACTS”));

startActivity(contactIntent);

8、顯示系統設置界面

Intent settingIntent = new Intent(“com.”));

startActivity(contactIntent);

Copyright © Linux教程網 All Rights Reserved