Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.android.lesson1;
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- public class DetailedActivity extends AppCompatActivity implements View.OnClickListener {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_detailed);
- Button firstButton = findViewById(R.id.firstButton);
- firstButton.setOnClickListener(this);
- }
- @Override
- public void onClick(View v) {
- switch (v.getId()) {
- case R.id.firstButton: {
- Intent intent = new Intent(this, MainActivity.class); // обращаемся к другому activity
- intent.putExtra("user_email", "ivanmel.vn23@gmail.com");
- startActivity(intent);
- break;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment