Back to project page Book-MetaSearch.
The source code is released under:
Apache License
If you think the Android project Book-MetaSearch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.grosinger.bookmetasearch.loader; //from www. jav a2 s . com import android.content.AsyncTaskLoader; import android.content.Context; import android.util.Log; import net.grosinger.bookmetasearch.book.Book; import java.util.ArrayList; import java.util.List; /** * Created by tony on 11/3/13. */ public class ProductLoader extends AsyncTaskLoader<List<Book>> { List<ProductQuery> queries; public ProductLoader(Context context) { super(context); queries = new ArrayList<ProductQuery>(); } @Override public List<Book> loadInBackground() { List<Book> results = new ArrayList<Book>(); for (ProductQuery query : queries) { List<Book> part = query.loadProducts(); if(part != null) { Log.d(getClass().getSimpleName(), "Adding results"); results.addAll(part); } } return results; } public void addProductQuery(ProductQuery query) { queries.add(query); } public void setSearchTerm(String searchTerm) { for (ProductQuery query : queries) { query.setSearchTerms(searchTerm); } } }