Back to project page Business-Communication-.
The source code is released under:
Eclipse Public License - v 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECI...
If you think the Android project Business-Communication- listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sabersoft.fblacommunication; //from w w w .j a va 2 s . co m import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast; public class Game2003 extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.game2003); // Attach the Game Layout File final TextView answer2001 = (TextView) findViewById(R.id.answer2001); answer2001.setVisibility(View.GONE); Button answerButton = (Button) findViewById(R.id.buttonAnswer2001); // Set TextView to not be "Visible" unless button is clicked answerButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub answer2001.setVisibility(View.VISIBLE); // Make TextView Visible when button is clicked } }); } public void onRadioButtonClicked(View view) { // Is the button now checked? boolean checked = ((RadioButton) view).isChecked(); // Check which radio button was clicked switch(view.getId()) { case R.id.game23a: if (checked) // Pirates are the best errorToast(); break; case R.id.game23b: if (checked) // Pirates are the best winToast(); break; case R.id.game23c: if (checked) // Pirates are the best errorToast(); break; case R.id.game23d: if (checked) // Pirates are the best errorToast(); break; } } private void errorToast() { Toast betaToast1 = Toast.makeText(this, "Incorrect. Sorry, try again!", Toast.LENGTH_SHORT); betaToast1.setGravity(Gravity.BOTTOM, 0, 230); betaToast1.show(); } private void winToast() { Toast betaToast2 = Toast.makeText(this, "Correct. Good Job!", Toast.LENGTH_SHORT); betaToast2.setGravity(Gravity.BOTTOM, 0, 230); betaToast2.show(); } }