I have a game running on android.
basically, it's structure is like lunarlander
I started my activity , using the layout to start the class running.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<my.darling.gameView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
When I pressed home, i can return to my game everytime. I always shut down the thread and create a new one.
The problem occurs when I pressed BACK botton.
I think my game finished. but after 4 times of "click the game" -> "click BACK"
There comes an error -> "stopped unexpectedly"
I've override the function : onPause()
and called finish()
. But it still happens.
can anyone help me?