public
Created

Easier findVewById()

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9
@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);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.