Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.83 KB | None | 0 0
  1. package com.example.chung.myapplication;
  2.  
  3. import android.content.Intent;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.widget.Button;
  8. import android.widget.EditText;
  9. import android.widget.TextView;
  10. import com.android.volley.RequestQueue;
  11. import com.android.volley.Response;
  12. import com.android.volley.toolbox.Volley;
  13.  
  14. import com.android.volley.Response;
  15.  
  16. import org.json.JSONException;
  17. import org.json.JSONObject;
  18.  
  19. public class Home2 extends AppCompatActivity {
  20.     @Override
  21.     protected void onCreate(Bundle savedInstanceState) {
  22.         super.onCreate(savedInstanceState);
  23.         setContentView(R.layout.activity_home2);
  24.         final TextView etUsername = (TextView)findViewById(R.id.tvUsername);
  25.         final TextView etVersion = (TextView)findViewById(R.id.tvVersion);
  26.         final TextView tvusername = (TextView)findViewById(R.id.tvusername);
  27.         final TextView tvpassword = (TextView)findViewById(R.id.tvpassword);
  28.         Button btnPAttend = (Button) findViewById(R.id.bPAttend);
  29.         Button btnPContact = (Button) findViewById(R.id.bPContact);
  30.         Button btnPHandbook = (Button) findViewById(R.id.bPHandbook);
  31.         Button btnPHomework = (Button) findViewById(R.id.bPHomework);
  32.         Button btnPNotice = (Button) findViewById(R.id.bPNotice);
  33.         Button btnPNotification = (Button) findViewById(R.id.bPNotification);
  34.         Intent intent = getIntent();
  35.         String type = intent.getStringExtra("type");
  36.         final String username = intent.getStringExtra("username");
  37.         final String password = intent.getStringExtra("password");
  38.         etUsername.setText(username);
  39.         etVersion.setText(type);
  40.         tvusername.setText(username);
  41.         tvpassword.setText(password);
  42.         btnPAttend.setOnClickListener(new View.OnClickListener(){
  43.             @Override
  44.             public void onClick(View view) {
  45.                 Intent intent = new Intent (Home2.this, Parent_attend.class);
  46.                 intent.putExtra("username",username);
  47.                 intent.putExtra("password",password);
  48.                 Home2.this.startActivity(intent);
  49.             }
  50.         });
  51.  
  52.         btnPContact.setOnClickListener(new View.OnClickListener(){
  53.             @Override
  54.             public void onClick(View view) {
  55.                 Intent intent = new Intent ();
  56.                 intent.setClass(Home2.this, Parent_contact.class);
  57.                 Home2.this.startActivity(intent);
  58.             }
  59.         });
  60.         btnPHandbook.setOnClickListener(new View.OnClickListener(){
  61.             @Override
  62.             public void onClick(View view) {
  63.                 Intent intent = new Intent ();
  64.                 intent.setClass(Home2.this, Parent_handbook.class);
  65.                 Home2.this.startActivity(intent);
  66.             }
  67.         });
  68.         btnPHomework.setOnClickListener(new View.OnClickListener(){
  69.             @Override
  70.             public void onClick(View view) {
  71.                 Intent intent = new Intent ();
  72.                 intent.setClass(Home2.this, Parent_homwork.class);
  73.                 Home2.this.startActivity(intent);
  74.             }
  75.         });
  76.         btnPNotice.setOnClickListener(new View.OnClickListener(){
  77.             @Override
  78.             public void onClick(View view) {
  79.                 Intent intent = new Intent ();
  80.                 intent.setClass(Home2.this, Parent_notice.class);
  81.                 Home2.this.startActivity(intent);
  82.             }
  83.         });
  84.         btnPNotification.setOnClickListener(new View.OnClickListener(){
  85.             @Override
  86.             public void onClick(View view) {
  87.                 Intent intent = new Intent ();
  88.                 intent.setClass(Home2.this, Parent_notification.class);
  89.                 Home2.this.startActivity(intent);
  90.             }
  91.         });
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement