Button myButton = findViewById(R.id.my_button); myButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // do some work v.postInvalidate(); } });In this example, the postInvalidate method is called on the view v (which is myButton) after some work has been done in the onClick method. The postInvalidate method is part of the android.view.View class, which is part of the Android framework. Therefore, it is included in the android.view package.