From b0a9bed5112dd3cd5e1cbb6b0ec9132d59fe7ef2 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 1 Feb 2016 11:42:59 -0800 Subject: Return empty result on blank query --- .../java/github/daneren2005/dsub/provider/DSubSearchProvider.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main/java') 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); -- cgit v1.2.3