package com.example.lessonThree;

import android.app.Activity;
import android.os.Bundle;

import com.example.lessonThree.MainGameView.MainGameThread;

public class HelloAndroid extends Activity 
{
    /** A handle to the thread that's actually running the animation. */
    private MainGameThread _mainGameThread;

    /** A handle to the View in which the game is running. */
    private MainGameView _mainGameView;

    /**
     * Invoked when the Activity is created.
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);

        // tell system to use the layout defined in our XML file

        // get handles to the LunarView from XML, and its LunarThread
        _mainGameView = new MainGameView(this);
        _mainGameThread = _mainGameView.getThread(); 
        setContentView(_mainGameView);
    }

    /**
     * Invoked when the Activity loses user focus.
     */
    @Override
    protected void onPause() 
    {
        super.onPause();
        _mainGameView.getThread().setRunning(false); // pause game when Activity pauses
    }
}