調用撥打電話界面
主要代碼如下:
//Intent.ACTION_DIAL= "android.intent.action.DIAL";
//不需要什麼權限
Intent intent = new Intent("android.intent.action.DIAL", Uri.parse("tel:10086"));
startActivity(intent);
直接撥打電話
主要代碼如下:
//Intent.ACTION_CALL= "android.intent.action.CALL";
//需要權限:<uses-permission android:name="android.permission.CALL_PHONE"/>
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:10086"));
startActivity(intent);
調用發送短信的界面有兩種:
1:定發送的号碼,和内容,界面沒有聯系人,群組組等按鈕。主要代碼如下:
//android.content.Intent.ACTION_SENDTO=Intent.ACTION_SENDTO="android.intent.action.SENDTO";
//不需要權限
Intent intent =new Intent(android.content.Intent.ACTION_SENDTO,Uri.parse("smsto:10086"));
intent.putExtra("sms_body","ye");
startActivity(intent);
2:設定發送短信内容,不設定發送的号碼,界面有聯系人,群組等按鈕。主要代碼如下:
//Intent.ACTION_VIEW= "android.intent.action.VIEW";
//不需要權限
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android-dir/mms-sms");
intent.putExtra("sms_body","ye");
startActivity(intent);
調用系統浏覽器
//Intent.ACTION_VIEW= "android.intent.action.VIEW";
//不需要權限
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.baidu.com"));
startActivity(intent);