return (int) (c.getResources().getDisplayMetrics().density * dip + 0.5f);
super.onCreate(savedInstanceState); DrawingView container = new DrawingView(this); setContentView(container);