java如何添加一个新object到layout中

比如,有一个ImageView:

public ImageView get_image_by_name(String name)
{
    int image_id = getResources().getIdentifier(name , "drawable", getPackageName());
    return (ImageView)findViewById(image_id);
}

不知道应该怎么添加到layout中?

 public void addView (View child)

Adds a child view. If no layout parameters are already set on the child, the default parameters for this ViewGroup are set on the child.

Note: do not invoke this method from draw(android.graphics.Canvas), onDraw(android.graphics.Canvas), dispatchDraw(android.graphics.Canvas) or any related method.

Parameters
child the child view to add