public static <T extends View> T findViewByName(Context context, Activity activity, String viewName) {
        int id = getResources(context).getIdentifier(viewName, "id", context.getPackageName());
        return activity.findViewById(id);
    }
findview

@param activity
@param viewName
@param <T>
@return
arms/src/main/java/com/jess/arms/utils/ArmsUtils.java