SHARE
TWEET

Untitled

a guest Apr 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.miquelbeltran.accordion;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7. import android.widget.TextView;
  8.  
  9. public class Accordion extends Activity {
  10.     private static final int MENU_NEW_GAME = 1;
  11.     private static final int MENU_QUIT = 2;
  12.     MainThread main_thread;
  13.     private RenderView render_view;
  14.     TextView tv;
  15.  
  16.     public void onCreate(Bundle savedInstanceState) {
  17.         super.onCreate(savedInstanceState);
  18.         this.render_view = new RenderView(this);
  19.         setContentView(this.render_view);
  20.         this.main_thread = new MainThread();
  21.         this.main_thread.setRenderView(this.render_view);
  22.         this.main_thread.start();
  23.     }
  24.  
  25.     public boolean onCreateOptionsMenu(Menu menu) {
  26.         menu.add(0, 1, 0, "New Game");
  27.         menu.add(0, 2, 0, "Quit");
  28.         return true;
  29.     }
  30.  
  31.     public boolean onOptionsItemSelected(MenuItem item) {
  32.         switch (item.getItemId()) {
  33.             case 1:
  34.                 this.main_thread.NewGame();
  35.                 return true;
  36.             case 2:
  37.                 this.main_thread.QuitGame();
  38.                 finish();
  39.                 return true;
  40.             default:
  41.                 return false;
  42.         }
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top