Skip to content

Commit

Permalink
add unregister method
Browse files Browse the repository at this point in the history
Hi, your repository is very cool.
I think, should we add a unregister method for onDestroy lifecycle? E.g Activity...
  • Loading branch information
LandChanning authored May 23, 2017
1 parent c9191bd commit 2f36763
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ public void registerHandler(String handlerName, BridgeHandler handler) {
messageHandlers.put(handlerName, handler);
}
}

/**
* unregister handler
*
* @param handlerName
*/
public void unregisterHandler(String handlerName) {
if (handlerName != null) {
messageHandlers.remove(handlerName);
}
}

/**
* call javascript registered handler
Expand Down

0 comments on commit 2f36763

Please sign in to comment.