public PieChartView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); pieChartRenderer = new PieChartRenderer(context, this, this); touchHandler = new PieChartTouchHandler(context, this); setChartRenderer(pieChartRenderer); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { this.rotationAnimator = new PieChartRotationAnimatorV8(this); } else { this.rotationAnimator = new PieChartRotationAnimatorV14(this); } setPieChartData(PieChartData.generateDummyData()); }