mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1175355
- Add AsyncQueryHandlerImpl in SearchActivity. r=nalexander
This avoids the "HandlerLeak" Android Lint warning. --HG-- extra : commitid : 3sLO4YQ6Gjk extra : rebase_source : 84cd05b1c4848895271e7f577ffa94b72de0281a
This commit is contained in:
parent
152d8dd058
commit
ea4537aef2
@ -19,6 +19,7 @@ import org.mozilla.search.providers.SearchEngineManager;
|
||||
import org.mozilla.search.providers.SearchEngineManager.SearchEngineCallback;
|
||||
|
||||
import android.content.AsyncQueryHandler;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
@ -92,6 +93,16 @@ public class SearchActivity extends Locales.LocaleAwareFragmentActivity
|
||||
private int cardPaddingX;
|
||||
private int cardPaddingY;
|
||||
|
||||
/**
|
||||
* An empty implementation of AsyncQueryHandler to avoid the "HandlerLeak" warning from Android
|
||||
* Lint. See also {@see org.mozilla.gecko.util.WeakReferenceHandler}.
|
||||
*/
|
||||
private static class AsyncQueryHandlerImpl extends AsyncQueryHandler {
|
||||
public AsyncQueryHandlerImpl(final ContentResolver that) {
|
||||
super(that);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
GeckoAppShell.ensureCrashHandling();
|
||||
@ -108,7 +119,7 @@ public class SearchActivity extends Locales.LocaleAwareFragmentActivity
|
||||
// Initialize the fragments with the selected search engine.
|
||||
searchEngineManager.getEngine(this);
|
||||
|
||||
queryHandler = new AsyncQueryHandler(getContentResolver()) {};
|
||||
queryHandler = new AsyncQueryHandlerImpl(getContentResolver());
|
||||
|
||||
searchBar = (SearchBar) findViewById(R.id.search_bar);
|
||||
searchBar.setOnClickListener(new View.OnClickListener() {
|
||||
|
Loading…
Reference in New Issue
Block a user