Advertisement
delvinkrasniqi

shfaqe textview TOAST

Nov 28th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. package com.example.myapplication;
  2.  
  3. import androidx.appcompat.app.AppCompatActivity;
  4. import android.os.Bundle;
  5. import android.view.View;
  6. import android.widget.Button;
  7. import android.widget.EditText;
  8. import android.widget.TextView;
  9. import android.widget.Toast;
  10.  
  11. import android.os.Bundle;
  12.  
  13. public class MainActivity extends AppCompatActivity {
  14.  
  15.     @Override
  16.     protected void onCreate(Bundle savedInstanceState) {
  17.         super.onCreate(savedInstanceState);
  18.         setContentView(R.layout.activity_main);
  19.  
  20.         final EditText editText4=(EditText)this.findViewById(R.id.editText4);
  21.         Button dergo=(Button)this.findViewById(R.id.button2);
  22.         final TextView textView2=(TextView)this.findViewById(R.id.textView2);
  23.         dergo.setOnClickListener(new View.OnClickListener() {
  24.             @Override
  25.             public void onClick(View v) {
  26.                 String emri=editText4.getText().toString();
  27.                 textView2.setText(emri);
  28.                 Toast.makeText(MainActivity.this,"Emri dhe Mbiemri jane derguar",Toast.LENGTH_LONG).show();
  29.             }
  30.         });
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement