diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-10-28 14:15:14 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-10-28 14:15:14 +0100 |
commit | 0ffc18be1a6d5edf644671cf5329fa74977da4ff (patch) | |
tree | b1971117dac35c6006ed49a749153d0447b7bc94 /src/de/danoeh/antennapod/feed | |
parent | 50b02ff77e76e75ad89c8ee0769edd25493d870f (diff) | |
download | AntennaPod-0ffc18be1a6d5edf644671cf5329fa74977da4ff.zip |
Added methods for searching descriptions to feedmanager
Diffstat (limited to 'src/de/danoeh/antennapod/feed')
-rw-r--r-- | src/de/danoeh/antennapod/feed/FeedManager.java | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/feed/FeedManager.java b/src/de/danoeh/antennapod/feed/FeedManager.java index 8ac58780f..479ce9732 100644 --- a/src/de/danoeh/antennapod/feed/FeedManager.java +++ b/src/de/danoeh/antennapod/feed/FeedManager.java @@ -1344,6 +1344,38 @@ public class FeedManager { }); } + public void searchFeedItemDescription(final Context context, + final Feed feed, final String query, + FeedManager.TaskCallback callback) { + dbExec.execute(new FeedManager.Task(new Handler(), callback) { + + @Override + public void execute() { + PodDBAdapter adapter = new PodDBAdapter(context); + adapter.open(); + Cursor searchResult = adapter.searchItemDescriptions(feed, query); + setResult(searchResult); + adapter.close(); + } + }); + } + + public void searchFeedItemContentEncoded(final Context context, + final Feed feed, final String query, + FeedManager.TaskCallback callback) { + dbExec.execute(new FeedManager.Task(new Handler(), callback) { + + @Override + public void execute() { + PodDBAdapter adapter = new PodDBAdapter(context); + adapter.open(); + Cursor searchResult = adapter.searchItemContentEncoded(feed, query); + setResult(searchResult); + adapter.close(); + } + }); + } + public List<Feed> getFeeds() { return feeds; } @@ -1373,7 +1405,7 @@ public class FeedManager { abstract class Task implements Runnable { private Handler handler; private TaskCallback callback; - + /** Can be used for returning database query results. */ private Cursor result; @@ -1410,7 +1442,7 @@ public class FeedManager { /** This method will be executed in the same thread as the run() method. */ public abstract void execute(); - + protected void setResult(Cursor c) { result = c; } |