Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mukeshdak.a20191208;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.Toast;
- public class MainActivity extends AppCompatActivity {
- Button mdButton;
- @Override
- protected void onCreate ( Bundle savedInstanceState ) {
- super.onCreate ( savedInstanceState );
- setContentView ( R.layout.activity_main );
- mdButton = findViewById ( R.id.mdButton );
- mdButton.setOnClickListener ( new View.OnClickListener () {
- @Override
- public void onClick ( View v ) {
- Toast.makeText ( getApplicationContext (), "Button is clicked", Toast.LENGTH_LONG ).show();
- }
- } );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment