package se.nekotronic.simpleball; import android.app.Activity; import android.os.Bundle; public class SimpleBouncingBallActivity extends Activity { private BounceView the_view; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); the_view = (BounceView)findViewById(R.id.bounceview); } @Override protected void onResume() { super.onResume(); // App is now visible (perhaps: again). Tell the view to start moving. the_view.resume(); } @Override protected void onPause() { super.onPause(); // App has been hidden. Tell the view to stop moving. the_view.pause(); } }