I have a game on Android.
basically this structure is similar to lunarlander
I started my activity using a layout to run a class.
<?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 clicked on the house, I can return to my game every time. I always close the stream and create a new one.
The problem occurs when I press BACK botton.
I think my game is over. but after 4 times "click game" → "click" BACK "
An error message appears - "unexpectedly stopped"
I redefine the function: onPause()and is called finish(). But this is still happening.
Can anybody help me?
source
share