Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Add @Receiver to inject the annotated receiver #852

@PerfectCarl

Description

@PerfectCarl

Android Receiver can be registered with code like this:

    ModuleDownloadedReceiver receiver = ...

    private void registerReceiver() {
        IntentFilter filter = new IntentFilter();
        filter.addAction("android.intent.action.DOWNLOAD_COMPLETE");
        context.registerReceiver(receiver, filter);
    }

But if the receiver has been annotated like this:

@EReceiver
public class ModuleDownloadedReceiver extends BroadcastReceiver {

    @Bean
    ModuleUtils moduleUtils;

}

... there is no annotation to inject the annotated receiver.
What I propose is a new @receiver annotation that would work pretty much like @Bean :

     @Receiver  
     ModuleDownloadedReceiver receiver ;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions