diff --git a/DEV4.5/exo3_controle b/DEV4.5/exo3_controle new file mode 100644 index 0000000..5033b4b --- /dev/null +++ b/DEV4.5/exo3_controle @@ -0,0 +1,47 @@ +package com.example.partition; + +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import androidx.appcompat.app.AppCompatActivity; + +public class ResponseActivity extends AppCompatActivity { + private TextView questionText; + private Button answerButton; + private String correctAnswer = "Bonne réponse!"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_response); + + questionText = findViewById(R.id.questionText); + answerButton = findViewById(R.id.answerButton); + + answerButton.setOnClickListener(v -> questionText.setText(correctAnswer)); + } +} + +Fichier activity_response.xml + + + + + +