Post startService() in onResume() as a possible fix to an Android P bug.

Got confirmation that the crash we're seeing is a bug, and this might be
a possible workaround.
This commit is contained in:
Greyson Parrelli
2018-10-16 11:47:58 -07:00
parent 92773b1a12
commit 7e485b8095
3 changed files with 19 additions and 4 deletions

View File

@@ -384,6 +384,10 @@ public class Util {
}
}
public static void postToMain(final @NonNull Runnable runnable) {
handler.post(runnable);
}
public static void runOnMain(final @NonNull Runnable runnable) {
if (isMainThread()) runnable.run();
else handler.post(runnable);