Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaked intention - missing call to unregisterreceiver #134

Open
jongbray opened this issue Jan 17, 2014 · 0 comments
Open

Leaked intention - missing call to unregisterreceiver #134

jongbray opened this issue Jan 17, 2014 · 0 comments

Comments

@jongbray
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant