Android Open Source - SCBIO-OneButtonLarry Result Activity






From Project

Back to project page SCBIO-OneButtonLarry.

License

The source code is released under:

MIT License

If you think the Android project SCBIO-OneButtonLarry listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.scbio.onebuttonlarry;
/*w ww . j ava2 s. c om*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class ResultActivity extends Activity {
  
  Intent mIntent;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_result);
    
    mIntent = new Intent();
    mIntent.putExtras(getIntent().getExtras());    
    
    long score = getIntent().getExtras().getLong("score");
    ((TextView) findViewById(R.id.scoreTextView)).setText(String.valueOf(score));    
    ((Button) findViewById(R.id.buttonSubmit)).setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        String player = ((EditText) findViewById(R.id.scorenameEditText)).getText().toString();
        
        if(player.length()<1){
          player = "NONAME";
        }
        
        mIntent.putExtra("player", player);
        setResult(RESULT_OK, mIntent);
        finish();
      }
    });
  }
}




Java Source Code List

org.scbio.onebuttonlarry.AboutActivity.java
org.scbio.onebuttonlarry.GameActivity.java
org.scbio.onebuttonlarry.HighscoreActivity.java
org.scbio.onebuttonlarry.HighscoreManager.java
org.scbio.onebuttonlarry.Highscore.java
org.scbio.onebuttonlarry.MainActivity.java
org.scbio.onebuttonlarry.MusicManager.java
org.scbio.onebuttonlarry.PreferencesManager.java
org.scbio.onebuttonlarry.ResultActivity.java
org.scbio.onebuttonlarry.game.GameStage.java
org.scbio.onebuttonlarry.game.GameView.java
org.scbio.onebuttonlarry.game.Larry.java
org.scbio.onebuttonlarry.game.Sprite.java
org.scbio.onebuttonlarry.stage.GapJumpStage.java
org.scbio.onebuttonlarry.stage.PlatformsStage.java
org.scbio.onebuttonlarry.stage.RockStage.java
org.scbio.onebuttonlarry.stage.RunStopStage.java