Commit 26086ee0 authored by Geoffrey Métais's avatar Geoffrey Métais

Util method to test if a list is null or empty

parent d4cdba55
......@@ -25,9 +25,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.support.annotation.Nullable;
import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.libvlc.util.MediaBrowser;
import org.videolan.vlc.VLCApplication;
import java.io.BufferedReader;
......@@ -35,6 +35,7 @@ import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.AbstractCollection;
import java.util.List;
public class Util {
......@@ -83,6 +84,10 @@ public class Util {
return false;
}
public static boolean isListEmpty(@Nullable AbstractCollection collection) {
return collection == null || collection.isEmpty();
}
public static boolean isCallable(Intent intent) {
List<ResolveInfo> list = VLCApplication.getAppContext().getPackageManager().queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment