Advertisement
mmayoub

Intent, second activity, java

Sep 5th, 2021
1,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package com.example.myapplication;
  2.  
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.view.View;
  6.  
  7. import androidx.appcompat.app.AppCompatActivity;
  8.  
  9. public class SecondActivity extends AppCompatActivity {
  10.  
  11.     @Override
  12.     protected void onCreate(Bundle savedInstanceState) {
  13.         super.onCreate(savedInstanceState);
  14.         setContentView(R.layout.activity_second);
  15.     }
  16.  
  17.     public void openFirst(View view) {
  18.         Intent intent = new Intent(this, FirstActivity.class);
  19.         startActivity(intent);
  20.  
  21.         finish();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement