This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LazyListManagerUtils { | |
public static <T> List<T> add(List<T> list, T item) { | |
if (list == null) { | |
list = new ArrayList<T>(); | |
list.add(item); | |
} | |
else if (!list.contains(item)) { | |
list.add(item); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("unchecked") | |
public static <T extends View> T findView(Activity activity, int id) { | |
return (T) activity.findViewById(id); | |
} | |
@SuppressWarnings("unchecked") | |
public static <T extends View> T findView(View view, int id) { | |
return (T) view.findViewById(id); | |
} |
NewerOlder