Android Open Source - study-android-fallballgame Main Activity

From Project

Back to project page study-android-fallballgame.


The source code is released under:

Apache License

If you think the Android project study-android-fallballgame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jp.hym.falingballgamge;
//from  ww w  .  j a  v a  2 s  .c  o m

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

public class MainActivity extends ActionBarActivity {

  protected void onCreate(Bundle savedInstanceState) {

        Log.d("test", "rotate="+getWindowManager().getDefaultDisplay().getOrientation());

    ViewGroup container = (ViewGroup)findViewById(;
    //Log.i("System.out" , "???????????");
    GameSurface gs = new GameSurface(this);

  public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(, menu);
    return true;

  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == {
      return true;
    return super.onOptionsItemSelected(item);


Java Source Code List