Android Utililty Methods Array Empty Check

List of utility methods to do Array Empty Check

Description

The list of methods to do Array Empty Check are organized into topic(s).

Method

booleanisNotEmpty(int[] array)

Checks if an array of primitive ints is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(long[] array)

Checks if an array of primitive longs is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(short[] array)

Checks if an array of primitive shorts is not empty or not null.

return (array != null && array.length != 0);
StringfindNonEmptyElement(String... strings)
find Non Empty Element
for (String string : strings) {
    if (!TextUtils.isEmpty(string)) {
        return string;
return "";
booleanisEmptyArray(Object[] obj)
is Empty Array
return isEmptyArray(obj, 1);
booleanisEmptyArray(Object[] array, int paramInt)
is Empty Array
if ((array == null) || (array.length < paramInt)) {
    return true;
return false;
booleanisByteArrayEmpty(byte[] bytes)
is Byte Array Empty
for (int i = 0; i < bytes.length; i++) {
    if (bytes[i] != 0x00) {
        return false;
return true;