diff --git a/doric-android/doric/src/main/java/pub/doric/performance/DoricPerformanceProfile.java b/doric-android/doric/src/main/java/pub/doric/performance/DoricPerformanceProfile.java index cd813def..91a34095 100644 --- a/doric-android/doric/src/main/java/pub/doric/performance/DoricPerformanceProfile.java +++ b/doric-android/doric/src/main/java/pub/doric/performance/DoricPerformanceProfile.java @@ -67,12 +67,22 @@ public class DoricPerformanceProfile { return this.name; } - public void addAnchorHook(AnchorHook hook) { - this.hooks.add(hook); + public void addAnchorHook(final AnchorHook hook) { + performanceHandler.post(new Runnable() { + @Override + public void run() { + hooks.add(hook); + } + }); } - public void removeAnchorHook(AnchorHook hook) { - this.hooks.remove(hook); + public void removeAnchorHook(final AnchorHook hook) { + performanceHandler.post(new Runnable() { + @Override + public void run() { + hooks.remove(hook); + } + }); } public void enable(boolean enable) {