Index: libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java |
diff --git a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java |
index 8788335568e691afb73c6b74b3404df09742a5ac..fc5e2f83377dfa3e38ce7ae5ff3cc073930e46e3 100644 |
--- a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java |
+++ b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java |
@@ -19,6 +19,7 @@ package org.adblockplus.libadblockplus.android.webviewapp; |
import android.content.Context; |
+import org.adblockplus.libadblockplus.FilterEngine; |
import org.adblockplus.libadblockplus.android.AdblockEngine; |
import org.adblockplus.libadblockplus.android.AndroidWebRequestResourceWrapper; |
import org.adblockplus.libadblockplus.android.settings.AdblockHelper; |
@@ -28,6 +29,25 @@ import java.util.Map; |
public class Application extends android.app.Application |
{ |
+ private final Runnable onAdblockEngineCreated = new Runnable() |
+ { |
+ @Override |
+ public void run() |
+ { |
+ FilterEngine engine = AdblockHelper.get().getProvider().getEngine().getFilterEngine(); |
+ // put your Adblock FilterEngine init here |
+ } |
+ }; |
+ |
+ private final Runnable onAdblockEngineDisposed = new Runnable() |
+ { |
+ @Override |
+ public void run() |
+ { |
+ // put your Adblock FilterEngine deinit here |
+ } |
+ }; |
+ |
@Override |
public void onCreate() |
{ |
@@ -45,6 +65,8 @@ public class Application extends android.app.Application |
AdblockHelper |
.get() |
.init(this, basePath, true, AdblockHelper.PREFERENCE_NAME) |
- .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map); |
+ .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map) |
+ .addEngineCreatedCallback(onAdblockEngineCreated) |
+ .addEngineDisposedCallback(onAdblockEngineDisposed); |
} |
} |