daily pastebin goal
1%
SHARE
TWEET

Untitled

GameMasterTZ Feb 11th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.gettysburgbattlefieldtourguide;
  2.  
  3. import android.annotation.SuppressLint;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.support.design.widget.FloatingActionButton;
  7. import android.support.design.widget.Snackbar;
  8. import android.support.v7.app.AppCompatActivity;
  9. import android.support.v7.widget.Toolbar;
  10. import android.view.View;
  11. import android.widget.Button;
  12.  
  13. import java.util.Objects;
  14.  
  15. public class Map extends AppCompatActivity {
  16.  
  17.     @SuppressLint("NewApi")
  18.     @Override
  19.     protected void onCreate(Bundle savedInstanceState) {
  20.         super.onCreate(savedInstanceState);
  21.         setContentView(R.layout.activity_map);
  22.         Toolbar toolbar = findViewById(R.id.toolbar);
  23.         setSupportActionBar(toolbar);
  24.  
  25.         FloatingActionButton fab = findViewById(R.id.fab);
  26.         fab.setOnClickListener(new View.OnClickListener() {
  27.             @Override
  28.             public void onClick(View view) {
  29.                 Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
  30.                         .setAction("Action", null).show();
  31.             }
  32.         });
  33.         Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
  34.     }
  35.  
  36.     Button GoToNewActivity;
  37.     @Override
  38.     protected void onCreate(Bundle savedInstanceState) {
  39.         super.onCreate(savedInstanceState);
  40.         setContentView(R.layout.activity_map);
  41.  
  42.         GoToNewActivity = findViewById(R.id.button);
  43.  
  44.         GoToNewActivity.setOnClickListener(new View.OnClickListener() {
  45.  
  46.             @Override
  47.             public void onClick(View v) {
  48.  
  49.                 // Intent code for open new activity through intent.
  50.  
  51.                 Intent intent = new Intent(Map.this, Location1.class);
  52.                 startActivity(intent);
  53.  
  54.             }
  55.         });
  56.     }}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top