Make toast work from a background thread

Authored by eduisters on Dec 7 2018, 10:54 AM.

Description

Make toast work from a background thread

Summary:
When receiving a text share an attempt is made to show a toast but that results
in an exception because the issuing thread is not running a looper.

Test Plan:
Without this patch applied Share a text with an android device using the plasmoid
Result: No toast is displayed and in logcat you will get a:

java.lang.RuntimeException: Can't toast on a thread that has not called Looper.prepare() exception

With this patch applied again Share a text an android device using the plasmoid
Result: The toast is actually displayed even when the activity is not in the foreground

Reviewers: KDE Connect, albertvaka

Reviewed By: KDE Connect, albertvaka

Subscribers: kdeconnect

Tags: KDE Connect

Differential Revision: https://phabricator.kde.org/D17400

Details

Committed
eduistersDec 7 2018, 6:22 PM
Reviewer
KDE Connect
Differential Revision
D17400: Make toast work from a background thread
Parents
R225:ebbd47704a9a: GIT_SILENT made messages (after extraction)
Branches
Unknown
Tags
Unknown