Posts

Showing posts with the label android-handler

java.lang.IllegalStateException: sending message to a Handler on a dead thread

java.lang.IllegalStateException: sending message to a Handler on a dead thread I have developed a game which makes use of lots of handlers.I am using admob interstitial ads.When a game level is cleared i show the interstitial ad but when i close the ad exception is thrown which i am not able to figure out The Exception is thrown only when i close the interstitial ad. Code : collectORCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { isCollectPressed = true; soundPlayer.playClickSound(); Utils.getInstance().playClickAnimation(v); handler.postDelayed(new Runnable() { @Override public void run() { addCandy(); dialog.dismiss(); getActivity().getSupportFragmentManager().popBackStack(); handler.postDelayed(new Runnable() { @Override public void run() { Utils.g...