Advertisement
mmayoub

Intent, first activity, java

Sep 5th, 2021
1,098
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 FirstActivity extends AppCompatActivity {
  10.  
  11.  
  12.     @Override
  13.     protected void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.activity_first);
  16.  
  17.     }
  18.  
  19.  
  20.     public void openSecond(View view) {
  21.         Intent intent = new Intent(this, SecondActivity.class);
  22.         startActivity(intent);
  23.  
  24.         finish();
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement