From 9082764d80db72775eb751fc2b6e744125f1e013 Mon Sep 17 00:00:00 2001 From: uholeschak Date: Fri, 20 Dec 2024 16:29:05 +0100 Subject: [PATCH] Central post function --- BmwDeepObd/MainActivity.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/BmwDeepObd/MainActivity.cs b/BmwDeepObd/MainActivity.cs index 99252bc31..74bf0832a 100644 --- a/BmwDeepObd/MainActivity.cs +++ b/BmwDeepObd/MainActivity.cs @@ -3592,17 +3592,11 @@ private void PostUpdateDisplay(bool force = false) if (force) { - if (!_updateHandler.HasCallbacks(_updateDisplayForceRunnable)) - { - _updateHandler.Post(_updateDisplayForceRunnable); - } + ActivityCommon.PostRunnable(_updateHandler, _updateDisplayForceRunnable); return; } - if (!_updateHandler.HasCallbacks(_updateDisplayRunnable)) - { - _updateHandler.Post(_updateDisplayRunnable); - } + ActivityCommon.PostRunnable(_updateHandler, _updateDisplayRunnable); } private void UpdateDisplay(bool forceUpdate = false) @@ -4909,17 +4903,16 @@ private void PostCompileCode() return; } - if (!_updateHandler.HasCallbacks(_compileCodeRunnable)) + if (ActivityCommon.PostRunnable(_updateHandler, _compileCodeRunnable)) { #if DEBUG - Log.Info(Tag, string.Format("PostCompileCode accepted: {0}", this)); + Log.Info(Tag, string.Format("PostCompileCode rejected: {0}", this)); #endif - _updateHandler.Post(_compileCodeRunnable); } else { #if DEBUG - Log.Info(Tag, string.Format("PostCompileCode rejected: {0}", this)); + Log.Info(Tag, string.Format("PostCompileCode accepted: {0}", this)); #endif } }