android set wrap_content programmatically custom view code example Example: set view size android someView.setLayoutParams(new LayoutParams(width, height));