Advertisement
Guest User

Untitled

a guest
Jul 30th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package maxim.android02;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.util.Log;
  7. import android.view.MotionEvent;
  8. import android.view.Window;
  9.  
  10. public class Activity_Main extends Activity {
  11.    
  12.     GameView view;
  13.    
  14.    
  15.     /** Called when the activity is first created. */
  16.     @Override
  17.     public void onCreate(Bundle savedInstanceState) {
  18.         super.onCreate(savedInstanceState);
  19.        
  20.         setGameView();
  21.        // setContentView(R.layout.main);
  22.     }
  23.  
  24.    
  25.   protected void onStart()
  26.     {
  27.       super.onStart();
  28.       this.setContentView(view);
  29.       view.startGameView();
  30.  
  31.     }
  32.    
  33.     protected void onDestroy()
  34.     {
  35.         super.onDestroy();
  36.         view.destroyGameView();
  37.     }
  38.    
  39.     protected void onPause()
  40.     {
  41.         super.onPause();
  42.         view.pauseGameView();
  43.     }
  44.  
  45.     protected void onResume()
  46.     {
  47.         super.onResume();
  48.         view.resumeGameView();
  49.     }
  50.    
  51.    
  52.     public void setGameView()
  53.     {
  54.         view= new MainMenu(this);
  55.     }
  56.    
  57.    
  58.     public void changeActivity()
  59.     {
  60.         Log.d("changing", "activity");
  61.         Intent i=new Intent(Activity_Main.this, Activity_Level.class);
  62.         startActivity(i);
  63.     }
  64.  
  65.    
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement