OpenSource For You

Intent Resolution

-

)Rr imSliFiW inWHnWs, AnGrRiG ‘figurHs RuW’ WhH righW FRmSRnHnW that can handle them. This process is called ‘ Intent Resolution’, which maps an Intent to an Activity, Broadcast Receiver or Service (or sometimes two or more activities/receivers) that can handle it. If an activity wants to receive a particular intent, it can do so in the two ways mentioned below: a) It should specify the same in the Android Manifest.xml, in

the <intent-filter> tags, as shown below:

b) <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> It can explicitly register a Broadcast Receiver using erReceiver(BroadcastR­eceiver, IntentFilt­er)

regist

Newspapers in English

Newspapers from India