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.

@EReceiver must override the "onReceiver" method even if @ReceiverAction exists #1239

@jiongxuan

Description

@jiongxuan

I met a question, hope someone do a favor.
If i do:

@EReceiver
public class NetworkReceiver extends BroadcastReceiver {
    @ReceiverAction(ConnectivityManager.CONNECTIVITY_ACTION)
    void onConnectivityChanged() {
        ...
    }

We will appear the following mistake during compilation:

Class 'NetworkReceiver' must either be declared abstract or implement abstract method 'onReceive(Context ,Intent)' in 'BroadcastReceiver'

But when I puted the NetworkReceiver into "abstract", AA was no longer generates a "NetworkReceiver_" file.

Now we only do:

    @ReceiverAction(ConnectivityManager.CONNECTIVITY_ACTION)
    void onConnectivityChanged() {
        ...
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        // Nothing
    }

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions