Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.brice.testauthentification;
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- public class Login extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_login);
- // EDIT TEXT PSEUDO
- EditText editTextUsername = (EditText) findViewById(R.id.editTextUsername);
- String username = editTextUsername.getText().toString();
- // EDIT TEXT MOT DE PASSE
- EditText editTextPassword = (EditText) findViewById(R.id.editTextPassword);
- String password = editTextPassword.getText().toString();
- // BOUTON DE CONNEXION
- Button buttonLogin = (Button) findViewById(R.id.buttonLogin);
- // LISTENER SUR LE BOUTON DE CONNEXION
- buttonLogin.setOnClickListener(new View.OnClickListener() {
- // ONCLIK BOUTON DE CONNEXION
- public void onClick(View actuelView) {
- //SI LA REQUETE RENVOIE TRUE ON PASSE A LA DEUXIEME ACTIVITE
- //IF
- Intent intent = new Intent(Login.this, Accueil.class);
- startActivity(intent);
- //SI LA REQUETE RENVOIE FALSE ON AFFICHE UN MESSAGE D'ERREUR
- //ELSE
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement