質問

I made an android app that shows an internal html with javascript in a webview. The javascript has an infinite loop to update the view once each minute.

The problem is that after I close my app with the back button, the javascript continues its infinite loop... Why is this happening and how can I prevent this?

Thanks! L.

役に立ちましたか?

解決

Why is this happening

Because you did not stop the loop. It will keep going until Android terminates the process.

how can I prevent this?

Stop the loop. You really should be stopping it in onPause() or onStop(), picking it up again (if needed) in onResume() or onStart().

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top