OnSuspend and CPU usage

Monkey Targets Forums/Android/OnSuspend and CPU usage

Volker(Posted 2013) [#1]
Hi,

all my apps show some cpu usage in the taskmanager while suspended.
Around 0.5 - 1.5 %.
OnSuspend() is getting called, and OnUpdate() not, like it should be.

Using Monkey V66.
Tested on Galaxy Tab 7 and Galaxy Note 10.1.

Can someone confirm this behaviour?

Example:
Import mojo



Class MyApp Extends App

	Field test:int
	Field count:int

	Method OnCreate()
		SetUpdateRate 15

	End Method 
	
	Method OnUpdate()
		count += 1

	End
	
	Method OnRender()
		Cls
		DrawText("Suspend called:" + test + " count:" + count, 100, 100)
	
	End
	
	Method OnSuspend()
'		Error("on suspend called")
		test = 1
	End Method
	
End

Function Main()

	New MyApp
	
End 



Xaron(Posted 2013) [#2]
But OnSuspend is hopefully called only once, isn't it?


Volker(Posted 2013) [#3]
Yes, I changed the code this way, and it's only called once.
	Method OnSuspend()
'		Error("on suspend called")
		test+ = 1
	End Method



Xaron(Posted 2013) [#4]
Ok, that's good. Beside that there is nothing you can do about it I guess. Don't know why the task manager still shows any CPU activity...