title: I am making an app through android studio using multiple intents.... and the intent is giving me a hard time . So please solve this one
body: <p>I am using intent to transfer activity from Main Activity to another activity .. and then from same to another activity and here the problem comes.. the intent is not working from the second level</p>
  <p>This is the MainActivity</p>
  <pre><code>package com.rajlearning.perimeterandareacalc;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      public void nor_cal(View v) {
          Intent intent = new Intent(this, MainActivity2.class);
          startActivity(intent);
      }
  
      public void heron(View v){
          Intent intent = new Intent(this, Heron.class);
          startActivity(intent);
      }
  
      public void per(View v){
          Intent intent = new Intent(this,Perimeter.class);
          startActivity(intent);
      }
  
      public void ar(View v){
          Intent intent = new Intent(this,ar.class);
          startActivity(intent);
      }
  }
  </code></pre>
  <p>This is the activity to which is used intent to transfer to from the MainActivity, and it worked.</p>
  <pre><code>package com.rajlearning.perimeterandareacalc;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  
  public class Perimeter extends AppCompatActivity {
      Button p_square,p_rectangle;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_perimeter);
          p_square= findViewById(R.id.button);
          p_rectangle= findViewById(R.id.button5);
  
          p_square.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(Perimeter.this,p_square.class);
                  
                  startActivity(intent);
              }
          });
          p_rectangle.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent i = new Intent(Perimeter.this, p_rectangle.class);
                  
                  startActivity(i);
              }
          });
      }
  }
  </code></pre>
  <p>This is the third activity which I tried to transfer from no. 2, and it didn't work.</p>
  <pre><code>package com.rajlearning.perimeterandareacalc;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class p_square extends AppCompatActivity {
      Button btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn0, btnAdd, btnSub, btnMul, btnDiv, btnDot, btnEqual, btnClear;
      EditText e1;
      float res,peri;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_psquare);
  
          btn1 = (Button) findViewById(R.id.btn1);
          btn2 = (Button) findViewById(R.id.btn2);
          btn3 = (Button) findViewById(R.id.button3);
          btn4 = (Button) findViewById(R.id.button8);
          btn5 = (Button) findViewById(R.id.button);
          btn6 = (Button) findViewById(R.id.button7);
          btn7 = (Button) findViewById(R.id.button13);
          btn8 = (Button) findViewById(R.id.button12);
          btn9 = (Button) findViewById(R.id.button11);
          btn0 = (Button) findViewById(R.id.button16);
          btnAdd = (Button) findViewById(R.id.button2);
          btnSub = (Button) findViewById(R.id.button37);
          btnMul = (Button) findViewById(R.id.button10);
          btnDiv = (Button) findViewById(R.id.button14);
          btnDot = (Button) findViewById(R.id.button9);
          btnEqual = (Button) findViewById(R.id.button15);
          btnClear = (Button) findViewById(R.id.button6);
  
          e1 = (EditText) findViewById(R.id.editTextNumber4);
  
          e1.setShowSoftInputOnFocus(false);
  
          btn1.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;1&quot;);
              }
          });
          btn2.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;2&quot;);
              }
          });
          btn3.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;3&quot;);
              }
          });
          btn4.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;4&quot;);
              }
          });
          btn5.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;5&quot;);
              }
          });
          btn6.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;6&quot;);
              }
          });
          btn7.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;7&quot;);
              }
          });
          btn8.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;8&quot;);
              }
          });
          btn9.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;9&quot;);
              }
          });
          btn0.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;0&quot;);
              }
          });
          btnDot.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(e1.getText() + &quot;.&quot;);
              }
          });
  
          btnClear.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  e1.setText(&quot;0&quot;);
              }
          });
  
          btnEqual.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  res = Float.parseFloat(e1.getText()+&quot;&quot;);
                  peri = 4*res;
                  e1.setText(peri+&quot;&quot;);
              }
          });
      }
  }
  </code></pre>