Intent Chinese translation comes from intention, but more reasonably means message-passing device.
How does 1.Intent expire in Android?
As a message transmitter, the first to have the ability to "load" and "unload" the message, in the Android source code, intent actually uses the ordinary message package (Buddle) to load the data.
Code from Android.content.Intent.class
public intent putextra (String name, charsequence value) { if (mextras == null) { mextras = new bundle (); //It's plain news. Parcel } Mextras.putcharsequence (name, value); return this;// This is a good discovery Oh } //add extra data, can be unlimited public Intent putextra (String name, bundle value) { if (mextras == null) { mextras = new bundle (); } mextras.Putbundle (Name, value); return this; } //here is the read section (uninstall) public String getstringextra (String name) { return mextras == null ? null : mextras.getstring (name); }
This only shows the Android data section
2.Intent data transfer is in need of direction, where is the direction?
What needs to be explained here is that the message of intent is broadcast, so the direction is the whole system.
How does 3.Intent find the specified target program?
It can be said that the message is sent out, but in order to find a suitable target, some columns need to be retrieved, these search conditions from action,componet,settype,catagory,packagename
We can often see that when we send a intent, there is not necessarily only one activity or broadcastreceiver or application response, so that's exactly how intent is a broadcast message.
4. Summary
Intent is a message-passing class that sets up and gets messages
Intent will be "broadcast to All Programs" to filter out the appropriate program
Intent is a cross-process, cross-app delivery
Intent carry a search condition
An in-depth understanding of intent in Android