Example usage for android.widget RelativeLayout removeViewAt

List of usage examples for android.widget RelativeLayout removeViewAt

Introduction

In this page you can find the example usage for android.widget RelativeLayout removeViewAt.

Prototype

public void removeViewAt(int index) 

Source Link

Document

Removes the view at the specified position in the group.

Usage

From source file:tv.acfun.video.HomeActivity.java

private void invalidateAvatarFrame() {
    mUser = null;/*from w w  w.  j  a  va  2  s .c o  m*/
    RelativeLayout leftDrawer = (RelativeLayout) mDrawer.findViewById(R.id.left_drawer);
    leftDrawer.removeViewAt(0);
    mAvatarFrame = getLayoutInflater().inflate(R.layout.avatar, leftDrawer, false);
    leftDrawer.addView(mAvatarFrame, 0);
    mAvatar = (ImageView) mAvatarFrame.findViewById(android.R.id.icon);
    mNameText = (TextView) mAvatarFrame.findViewById(android.R.id.text1);
}