I have a library module "A" which is initialized on the application.onCreate() of android application (wrapper). In case there is any uncaught exception in module "A", it sends a broadcast which should be received by a receiver in module "B" which in-turn sends the info to the server.
Now the problem is that when an exception is caught in module "B", it sends the broadcast but it is never received and the apps hangs.
My code in onCreate() of module A's only activity. I am using LocalBroadcastManager to send the broadcasts.
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
trackCardInfoSessionEnd(CardInfoAnalyticsConstants.CARD_INFO_BROADCAST_SESSION_END, "failed");
finish();
}
});