service--->service
action--->service
activitity--->activity
action---->广播
这些组件之间的连接者都是intent
<category android:name="android.intent.category.LAUNCHER" />这个代表应用图标
显示意图只能启动当前程序的活动,不能启动其他程序的活动
Intent it = new Intent();
it.setClass(SecondActivity.this,ThirdActivity.class);
startActivity(it);
隐式意图
mainifest.xml 中
定义一个 intent-filter
<intent-filter>
<action android:name="com.androidless1.yifei.Guorenyu"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
activity中的intent代码
Intent it = new Intent(); //不显示的写出 class名字,而是写一个action的名字等于xml中action的name
it.setAction("com.androidless1.yifei.Guorenyu");
startActivity(it);