Intent中文翻譯過來是意圖,但更合理的意思是消息傳遞器。android
做爲 消息傳遞器,首先的具有 「裝載」和 「卸載」消息的能力,在Android源代碼中,Intent實際上是用了普通消息包裹(Buddle)來裝載數據。this
代碼來自android.content.Intent.classspa
public Intent putExtra(String name, CharSequence value) { if (mExtras == null) { mExtras = new Bundle(); //這是普通消息包裹 } mExtras.putCharSequence(name, value); return this;//這是一個不錯的發現哦 } //添加額外數據,能夠無限制是用 public Intent putExtra(String name, Bundle value) { if (mExtras == null) { mExtras = new Bundle(); } mExtras.putBundle(name, value); return this; } //這裏是讀取部分(卸載) public String getStringExtra(String name) { return mExtras == null ? null : mExtras.getString(name); }
這裏只說明android的數據部分翻譯
這裏須要說明的是Intent的消息是廣播出去的,因此說方向是系統。code
能夠說消息是發送出去了,可是爲了找到適合的目標,須要進行一些列的檢索,這些檢索條件來自Action,Componet,setType,Catagory,PackageName進程
咱們常常能看到,當咱們發送一個Intent時,不必定只會有一個Activity或者BroadcastReceiver或者應用程序響應,因此這偏偏說明了Intent是一種被廣播出去的消息。get
Intent 是一種消息傳遞器,課設置和獲取消息it
Intent 會被「廣播給全部程序",進而篩選出適合條件的程序io
Intent 是能夠跨進程,跨應用傳遞的ast
Intent 攜帶有檢索條件