static void CreateAgent(AgentStartOptions startOptions) { mainContext.Post( s => { timer.Dispose(); agent = new AndroidAgent(activityTracker).Start(startOptions); }, null); }
static void CreateAgent(AgentStartOptions startOptions) { StopBreakdance(); var source = IntPtr.Zero; source = Dispatch.ScheduleRepeatingTimer(TimeSpan.FromSeconds(0), userdata => { Dispatch.Cancel(source); agent = new UnifiedAgent().Start(startOptions); }); }