Android BroadcastReceiver with no intent-filter

前端 未结 4 554
孤独总比滥情好
孤独总比滥情好 2021-01-01 22:43

I\'ve come across something like this in the AndroidManifest.xml:


The above

4条回答
  •  心在旅途
    2021-01-01 23:09

    An Intent filter is needed in case of implicit intents, and if an intent filter is not specified, it must be invoked explicitly. So to invoke this receiver you would need to invoke:

    Intent intent = new Intent(getApplicationContext(), com.testco.test.TestReceiver.class);
    sendBroadcast(intent);`
    

提交回复
热议问题