Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. package com.example.gagaga;
  2.  
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5.  
  6. import com.google.android.material.floatingactionbutton.FloatingActionButton;
  7. import com.google.android.material.snackbar.Snackbar;
  8.  
  9. import androidx.appcompat.app.AppCompatActivity;
  10. import androidx.appcompat.widget.Toolbar;
  11.  
  12. import android.view.View;
  13. import android.widget.Button;
  14.  
  15. public class modelx extends AppCompatActivity {
  16.         private Button button;
  17.     @Override
  18.     protected void onCreate(Bundle savedInstanceState) {
  19.         super.onCreate(savedInstanceState);
  20.         setContentView(R.layout.activity_modelx);
  21.         button = (Button)findViewById(R.id.BackBut);
  22.         button.setOnClickListener(new View.OnClickListener() {
  23.             @Override
  24.             public void onClick(View v) {
  25.                 BackTo1();
  26.             }
  27.         });
  28.     }
  29.  
  30.     public void BackTo1(){
  31.         Intent intent = new Intent(this, MainActivity.class);
  32.         startActivity(intent);
  33.     }
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement