ashishb.net

Technology, books, travel, and linguistics

Day: October 21, 2023

#all #Programming

Android: Always show toasts on the background thread

I used to call Toast#show() on the UI thread. Then one day, I received notifications related to an ANR (Application Not Responding) error in one of my Android apps. at android.os.BinderProxy.transactNative(BinderProxy.java) at android.os.BinderProxy.transact(BinderProxy.java:605) at android.view.accessibility.IAccessibilityManager$Stub$Proxy.addClient(IAccessibilityManager.java:1207) at android.view.accessibility.AccessibilityManager.tryConnectToServiceLocked(AccessibilityManager.java:1804) at android.view.accessibility.AccessibilityManager.(AccessibilityManager.java:606) at […]