Author: Not specified Language: text
Description: Not specified Timestamp: 2013-06-17 19:33:32 +0000
View raw paste Reply
  1.  
  2. package com.example.gamerandomizer;
  3.  
  4. import android.annotation.SuppressLint;
  5. import android.annotation.TargetApi;
  6. import android.app.Activity;
  7. import android.content.Intent;
  8. import android.os.Build;
  9. import android.os.Bundle;
  10. import android.view.Menu;
  11. import android.view.View;
  12. import android.widget.EditText;
  13.  
  14. public class AddGame extends Activity {
  15.  
  16.     @SuppressLint("NewApi")
  17.     @Override
  18.     protected void onCreate(Bundle savedInstanceState) {
  19.         super.onCreate(savedInstanceState);
  20.         setContentView(R.layout.activity_add_game);
  21.         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
  22.             getActionBar() .setDisplayHomeAsUpEnabled(true);
  23.         }
  24.     }
  25.  
  26.     /**
  27.      * Set up the {@link android.app.ActionBar}, if the API is available.
  28.      */
  29.     @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  30.     private void setupActionBar() {
  31.         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  32.             getActionBar().setDisplayHomeAsUpEnabled(true);
  33.         }
  34.     }
  35.     public void openGames (View view) {
  36.         Intent intent = new Intent(this, GameSelection.class);
  37.         EditText editText = (EditText) findViewById(R.id.type_game);
  38.         String game = editText.getText().toString();
  39.         aGames[1] = game;
  40.         System.out.println(game);
  41.  
  42.        
  43.         startActivity(intent);
  44.     }
  45.  
  46.    
  47.  
  48.     @Override
  49.     public boolean onCreateOptionsMenu(Menu menu) {
  50.         // Inflate the menu; this adds items to the action bar if it is present.
  51.         getMenuInflater().inflate(R.menu.add_game, menu);
  52.         return true;
  53.     }
  54.  
  55. }
  56.  
View raw paste Reply