I'm going through the Wi-Fi Direct tutorials for Android and had a quick question about how they're using an IntentFilter
in the section "Set Up a Broadcast Receiver and Peer-to-Peer Manager".
There, they manually configure an instance of IntentFilter
for the activity and instantiate it in onCreate()
. Then, in onResume()
, the IntentFilter
is passed in to registerReceiver()
.
What's the specific reason as to why the IntentFilter
is configured here and what would be a reason as to why these intents couldn't just be set up in AndroidManifest.xml
?