Advertisement
Guest User

Pwet

a guest
Apr 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package com.example.brice.testauthentification;
  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.  
  10. public class Login extends AppCompatActivity {
  11.  
  12. @Override
  13. protected void onCreate(Bundle savedInstanceState) {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.activity_login);
  16.  
  17. // EDIT TEXT PSEUDO
  18. EditText editTextUsername = (EditText) findViewById(R.id.editTextUsername);
  19. String username = editTextUsername.getText().toString();
  20.  
  21. // EDIT TEXT MOT DE PASSE
  22. EditText editTextPassword = (EditText) findViewById(R.id.editTextPassword);
  23. String password = editTextPassword.getText().toString();
  24.  
  25. // BOUTON DE CONNEXION
  26. Button buttonLogin = (Button) findViewById(R.id.buttonLogin);
  27.  
  28. // LISTENER SUR LE BOUTON DE CONNEXION
  29. buttonLogin.setOnClickListener(new View.OnClickListener() {
  30. // ONCLIK BOUTON DE CONNEXION
  31. public void onClick(View actuelView) {
  32. //SI LA REQUETE RENVOIE TRUE ON PASSE A LA DEUXIEME ACTIVITE
  33. //IF
  34. Intent intent = new Intent(Login.this, Accueil.class);
  35. startActivity(intent);
  36.  
  37. //SI LA REQUETE RENVOIE FALSE ON AFFICHE UN MESSAGE D'ERREUR
  38. //ELSE
  39. }
  40. });
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement