aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-02-01 11:42:59 -0800
committerScott Jackson <daneren2005@gmail.com>2016-02-01 11:42:59 -0800
commitb0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2 (patch)
tree7d0afd54d4ca341a44bd97d68850150037d0b710 /app/src/main/java
parent14bf01b785d539e16536f335603852284c0d4c29 (diff)
downloaddsub-b0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2.tar.gz
dsub-b0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2.tar.bz2
dsub-b0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2.zip
Return empty result on blank query
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java b/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java
index f91c364e..ba8c80c1 100644
--- a/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java
+++ b/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java
@@ -58,6 +58,10 @@ public class DSubSearchProvider extends ContentProvider {
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ if(selectionArgs[0].isEmpty()) {
+ return null;
+ }
+
String query = selectionArgs[0] + "*";
SearchResult searchResult = search(query);
return createCursor(selectionArgs[0], searchResult);