Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.mbledhja;
- import androidx.appcompat.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.RadioButton;
- import android.widget.TextView;
- public class MainActivity extends AppCompatActivity {
- RadioButton kuq , blu , verdhe;
- TextView txtView;
- Button button;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- kuq=(RadioButton)findViewById(R.id.radioButton);
- blu=(RadioButton)findViewById(R.id.radioButton2);
- verdhe=(RadioButton)findViewById(R.id.radioButton3);
- txtView=(TextView)findViewById(R.id.textView4);
- button=(Button)findViewById(R.id.button2);
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if(kuq.isChecked()){
- txtView.setText("Keni zgjedhur ngjyre te kuqe");
- }
- else if(blu.isChecked()){
- txtView.setText("Keni zgjedhur ngjyre blu");
- }
- else if (verdhe.isChecked()){
- txtView.setText("Keni zgjedhur ngjyre verdh");
- }
- else{
- txtView.setText("Ju skeni sgjedhur asnje ngjyre");
- }
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement