1
2
3
4
5
6
7
8
9
10
public class PieChartDemo01View extends View {
public PieChartDemo01View(Context context) {
    super(context);
//getApplicationContext() is giving error
Drawable drawable = getApplicationContext().getResources().getDrawable(
        R.drawable.bg2);
    BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;

}
}