SubmitCheatInstructions.java :  » Database-Persistance » cheatdatabase-android » com » cheatdatabase » android » Android Open Source

Android Open Source » Database Persistance » cheatdatabase android 
cheatdatabase android » com » cheatdatabase » android » SubmitCheatInstructions.java
package com.cheatdatabase.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

public class SubmitCheatInstructions extends Activity {

  private TextView tvInstructionsTitle, tvInstructionsText;

  private final int HOME = 0;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.submitcheat_instructions);

    tvInstructionsTitle = (TextView) findViewById(R.id.tvCheatInstructionsTitle);
    tvInstructionsTitle.setText(R.string.submit_cheat_instructions_title);

    tvInstructionsText = (TextView) findViewById(R.id.tvCheatInstructionsText);
    tvInstructionsText.setText(R.string.submit_cheat_instructions_text);
  }

  /**
   * Aufbau vom Android-Men
   */
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(0, HOME, 0, R.string.goto_main_screen);
    return true;
  }

  /**
   * Handles item selections
   */
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case HOME:
      goHome();
      return true;
    }
    return false;
  }

  private void goHome() {
    Intent explicitIntent = new Intent(SubmitCheatInstructions.this, CheatDatabaseAndroid.class);
    startActivity(explicitIntent);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.