Advertisement
Zidinjo

Activity

Oct 23rd, 2015
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1.  
  2.  
  3. import android.support.v7.app.AppCompatActivity;
  4. import android.os.Bundle;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7.  
  8. public class GameActivity extends AppCompatActivity {
  9.  
  10.  
  11.     private GameView gameView;
  12.     @Override
  13.     protected void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.activity_game);
  16.         gameView = new GameView(this);
  17.     }
  18.  
  19.     @Override
  20.     public boolean onCreateOptionsMenu(Menu menu) {
  21.         // Inflate the menu; this adds items to the action bar if it is present.
  22.         getMenuInflater().inflate(R.menu.menu_game, menu);
  23.         return true;
  24.     }
  25.  
  26.     @Override
  27.     public boolean onOptionsItemSelected(MenuItem item) {
  28.         // Handle action bar item clicks here. The action bar will
  29.         // automatically handle clicks on the Home/Up button, so long
  30.         // as you specify a parent activity in AndroidManifest.xml.
  31.         int id = item.getItemId();
  32.  
  33.         //noinspection SimplifiableIfStatement
  34.         if (id == R.id.action_settings) {
  35.             return true;
  36.         }
  37.  
  38.         return super.onOptionsItemSelected(item);
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement