1、打电话
Intent intentCall=new Intent();
intentCall.setAction(Intent.ACTION_CALL);
intentCall.setData(Uri.parse("tel://18679451786"));
startActivity(intentCall);
2、浏览器
Intent MsgCall=new Intent();
MsgCall.setAction(Intent.ACTION_VIEW);
MsgCall.setData(Uri.parse("http://www.baidu.com"));
startActivity(MsgCall);
3、放音乐
Intent videoIntent=new Intent();
videoIntent.setAction(Intent.ACTION_VIEW);
videoIntent.setDataAndType(Uri.parse("file:///mnt/sdcard/today.mp3"),"audio/*");
startActivity(videoIntent);
4、发短信
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("smsto:10086"));
intent.putExtra("sms_body","The SMS text");
startActivity(intent);
在当前的activity中添加过滤器
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.CALL"/>
<data android:scheme="tel"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="file" android:mimeType="audio/*"/>
<data android:scheme="file" android:mimeType="video/*" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>