CalledFromWrongThreadListener
interface CalledFromWrongThreadListener
| android.view.View.CalledFromWrongThreadListener |
A listener that is notified when certain View APIs are called from the wrong thread.
Example use case:
<code> View.registerCalledFromWrongThreadListener(() -> { // Handle the issue, e.g. crash if this is a dev build, or log an event // Unregister the listener to avoid being notified again of possibly the same problem View.unregisterCalledFromWrongThreadListener(this); }); </code>
Summary
| Public methods | |
|---|---|
| abstract Unit |
Called when a View API is called from the wrong thread. |
Public methods
onCalledFromWrongThread
abstract fun onCalledFromWrongThread(): Unit
Called when a View API is called from the wrong thread.