Solution for handler deprecated

My code when using processing 3 works with the previous handler code: But for processing 4, it indicated handler deprecated. I am trying to fix the code but I could not fix it until not. Any solution to fix the code could be much appreciated. Below is the current structure of the code that I could not solve:

private final Handler mHandler = new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void handleMessage(Message msg)
{
switch (msg.what)
{
case MESSAGE_WRITE:
break;
case MESSAGE_READ:
byte[] readBuf = (byte[]) msg.obj;
readMessage = new String(readBuf, 0, msg.arg1);
break;
}
}
}, 1000);

Based on the information here on android official documentation. You can try -
new Handler(Looper.myLooper())

All the best,
Rupesh