diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-02-01 11:42:59 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-02-01 11:42:59 -0800 |
commit | b0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2 (patch) | |
tree | 7d0afd54d4ca341a44bd97d68850150037d0b710 /app/src/main/java | |
parent | 14bf01b785d539e16536f335603852284c0d4c29 (diff) | |
download | dsub-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.java | 4 |
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); |