What is the replacement for Handler that has recently become obsolete in Android API 30?

Handler seems to have been removed in API 30. I used Handler to delay code execution

Example code below

final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                view.setVisibility(View.VISIBLE);
            }
        }, 1000);

What code should I write now to delay code execution?

Answer

Handler seems to have been removed in API 30.

No, it has not. It still exists. Certain constructors have been deprecated.

What code should I write now to delay code execution?

The simplest solution is to call postDelayed() on any View.