@Nullable
    public static <T extends Parcelable> SparseArray<T> optSparseParcelableArray(@Nullable Bundle bundle, @Nullable String key, @Nullable SparseArray<T> fallback) {
        if (bundle == null) {
            return fallback;
        }
        return bundle.getSparseParcelableArray(key);
    }
@ Nullable public static < T extends Parcelable > SparseArray < T > optSparseParcelableArray ( @ Nullable Bundle bundle , @ Nullable String key , @ Nullable SparseArray < T > fallback ) { if ( bundle == null ) { return fallback ; } return bundle . getSparseParcelableArray ( key ) ; }
Returns a optional {@link android.util.SparseArray} value. In other words, returns the value mapped by key if it exists and is a {@link android.util.SparseArray}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return null.
@param key a key for the value.
@param fallback fallback value.
@return a {@link android.util.SparseArray} value if exists, null otherwise.
@see android.os.Bundle#getSparseParcelableArray(String)