Add code as given by Rowena. Currently broken!

This commit is contained in:
bspeice
2013-12-02 17:41:14 -05:00
parent 07f1a25742
commit 32ed9bcb53
5 changed files with 140 additions and 35 deletions

View File

@ -1,23 +1,68 @@
package com.uncc.gameday.activities;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.uncc.gameday.R;
// TODO: Auto-generated Javadoc
/**
* The Class Registration.
*/
public class Registration extends MenuActivity {
public class Registration extends MenuActivity implements android.content.DialogInterface.OnClickListener {
/* (non-Javadoc)
* @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle)
*/
private Button b;
private TextView t;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
b=(Button)findViewById(R.id.buttonRegister);
b.setOnClickListener((OnClickListener) this);
t=(TextView)findViewById(R.id.buttonRegister);
}
}
public void onClick(View v) {
AlertDialog ad = new AlertDialog.Builder(this)
.setMessage("Are you ready to register with UNCC GAME DAY?")
.setTitle("Confirmation")
.setPositiveButton("Yes", this)
.setNegativeButton("No", this)
.setNeutralButton("Edit", this)
.setCancelable(false)
.create();
ad.show();
}
public void onClick(DialogInterface dialog, int which) {
switch(which){
case DialogInterface.BUTTON_POSITIVE: // yes
t.setText("Your registration has been accepted. Welcome!");
break;
case DialogInterface.BUTTON_NEGATIVE: // no
t.setText("You may come back and register at amy time.");
break;
case DialogInterface.BUTTON_NEUTRAL: // neutral
t.setText("Please correct any errors and select REGISTER.");
break;
default:
// nothing
break;
}
}
}