Skip to content

Leaked intention - missing call to unregisterreceiver #134

@jongbray

Description

@jongbray

I was getting an error message when I shut down my application and, being hopeless at Java, couldn't work out where to put said call. I spoke to Matt Kane and, although they're no longer developing this plugin, he very kindly gave me the following code, which works fine when inserted into HeadsetWatcher.java at line 29 (ie in the HeadsetWatcher class). I'm using Cordova 2.0.0.

He did ask me to send a Pull request if it works, but that would involve me installing and learning how to use github and I might just end up breaking things at either end, so I figured this was easier!

@OverRide
public void onDestroy() {
this.cordova.getActivity().unregisterReceiver(headsetReceiver);
super.onDestroy();
}

Thanks Matt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions