Advertisement
mmayoub

Counter, MainActivity2.java

Oct 15th, 2021
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. package com.example.myapplication0710;
  2.  
  3. import androidx.appcompat.app.AppCompatActivity;
  4.  
  5. import android.content.Intent;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.widget.Button;
  9. import android.widget.Toast;
  10.  
  11. public class MainActivity2 extends AppCompatActivity {
  12.     Button btnBack;
  13.  
  14.     @Override
  15.     protected void onCreate(Bundle savedInstanceState) {
  16.         super.onCreate(savedInstanceState);
  17.         setContentView(R.layout.activity_main2);
  18.  
  19.         btnBack=findViewById(R.id.btnBack);
  20.  
  21.  
  22.         Intent intent= this.getIntent();
  23.         int c=intent.getIntExtra("COUNT_VALUE",-1);
  24.         btnBack.setText(c+"");
  25.  
  26.         Toast.makeText(this, c+"", Toast.LENGTH_LONG).show();
  27.     }
  28.  
  29.     public void clickMe(View view) {
  30.         //Intent intent = new Intent(this, MainActivity.class);
  31.         //startActivity(intent);
  32.  
  33.         finish();
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement