Guest User

Untitled

a guest
Nov 20th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package cqc.quiz;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.text.Html;
  6. import android.view.View;
  7. import android.view.View.OnClickListener;
  8. import android.widget.Button;
  9.  
  10. public class CQCQuizActivity extends Activity {
  11.     /** Called when the activity is first created. */
  12.     @Override
  13.     public void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.main);
  16.        
  17.         Button main1 = (Button) findViewById(R.id.main1);
  18.         main1.setOnClickListener(new OnClickListener() {
  19.            
  20.             public void onClick(View v) {
  21.                 setContentView(R.layout.simulazione_esame);
  22.                
  23.             }
  24.         });
  25.        
  26.         Button main2 = (Button) findViewById(R.id.main2);
  27.         main2.setOnClickListener(new OnClickListener() {
  28.            
  29.             public void onClick(View v) {
  30.                 setContentView(R.layout.statistiche);
  31.                
  32.             }
  33.         });
  34.        
  35.         Button home = (Button) findViewById(R.id.home);
  36.         home.setOnClickListener(new OnClickListener() {
  37.            
  38.             public void onClick(View v) {
  39.                 setContentView(R.layout.main);
  40.                
  41.             }
  42.         });
  43.     }
  44. }
Add Comment
Please, Sign In to add comment