diff --git a/app/src/main/java/acr/browser/lightning/search/SuggestionsManager.java b/app/src/main/java/acr/browser/lightning/search/SuggestionsManager.java index 3ea94d7..48bde01 100644 --- a/app/src/main/java/acr/browser/lightning/search/SuggestionsManager.java +++ b/app/src/main/java/acr/browser/lightning/search/SuggestionsManager.java @@ -1,5 +1,6 @@ package acr.browser.lightning.search; +import android.app.Application; import android.content.Context; import android.support.annotation.NonNull; @@ -26,13 +27,14 @@ class SuggestionsManager { } static Observable> getObservable(@NonNull final String query, @NonNull final Context context, @NonNull final Source source) { + final Application application = BrowserApp.get(context); return Observable.create(new Action>() { @Override public void onSubscribe(@NonNull final Subscriber> subscriber) { sIsTaskExecuting = true; switch (source) { case GOOGLE: - new GoogleSuggestionsTask(query, BrowserApp.get(context), new SuggestionsResult() { + new GoogleSuggestionsTask(query, application, new SuggestionsResult() { @Override public void resultReceived(@NonNull List searchResults) { subscriber.onNext(searchResults); @@ -41,7 +43,7 @@ class SuggestionsManager { }).run(); break; case DUCK: - new DuckSuggestionsTask(query, BrowserApp.get(context), new SuggestionsResult() { + new DuckSuggestionsTask(query, application, new SuggestionsResult() { @Override public void resultReceived(@NonNull List searchResults) { subscriber.onNext(searchResults);