Code example for Picture

0
import android.view.View; 
import android.view.ViewGroup; 
import android.view.ViewParent; 
 
public class PictureLayout extends ViewGroup {
    private final Picture mPicture = new Picture();
 
    public PictureLayout(Context context) {
        super(context);
    } 
 
    public PictureLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    } 
 
    @Override 
    public void addView(View child) {
        if (getChildCount() > 1) {
            throw new IllegalStateException("PictureLayout can host only one direct child");
        }