View myView = findViewById(R.id.my_view); myView.setDrawingCacheEnabled(true);
View myView = findViewById(R.id.my_view); myView.setDrawingCacheEnabled(false);In this example, we retrieve a reference to the same view as in the previous example and disable its drawing cache by calling the setDrawingCacheEnabled method and passing in a value of false. The setDrawingCacheEnabled method belongs to the android.view.View class, which is part of the Android framework.