Android examples for java.util:Set
Convert object array to Set
//package com.book2s; import java.util.HashSet; import java.util.Set; public class Main { public static <T> Set<T> toSet(T[] array) { HashSet<T> set = new HashSet<T>(); if (array != null) { for (T object : array) { set.add(object);/*from w w w . j av a 2 s . c o m*/ } } return set; } }