If I understand it correctly, the application which wants to show toasts only needs to install the shortcut once. So to prevent running code which is only needed once, at every time the application wants to show a toast, I would suggest splitting the logic into multiple steps (and classes).
This also would improve the readability of the code.
If I understand it correctly, the application which wants to show toasts only needs to install the shortcut once. So to prevent running code which is only needed once, at every time the application wants to show a toast, I would suggest splitting the logic into multiple steps (and classes).
This also would improve the readability of the code.