Back to project page pong-android.
The source code is released under:
MIT License
If you think the Android project pong-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.zamecnik.android.pong; /*from w w w . j a va 2 s. com*/ import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.widget.TextView; public class GameActivity extends Activity { static final String LOG_TAG = "Game"; private GameView gameView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView fpsTextView = (TextView) findViewById(R.id.fpsTextView); FpsCounter fpsCounter = new FpsCounter(fpsTextView); LinearLayout layout = (LinearLayout) findViewById(R.id.frame); gameView = new PongGameView(getApplicationContext()); gameView.setFpsCounter(fpsCounter); layout.addView(gameView); } @Override protected void onPause() { super.onPause(); gameView.pause(); } }