1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to open Google Maps from button?

Discussion in 'Android Apps & Games' started by bgalakazam, May 21, 2011.

  1. bgalakazam

    bgalakazam Lurker
    Thread Starter

    I am trying to open Google Maps in a new activity so that my main screen is different. The app crashes. Here is the button code:

    Code (Text):
    1. mapsButton.setOnClickListener(new View.OnClickListener() {
    2.             public void onClick(View v) {
    3.                 startActivity(new Intent("com.grigorovl.Map"));
    5.             }
    6.         });
    Below are the classes:
    Main.java [Java] Main.java - Pastebin.com
    Map.java [Java] Map.xml - Pastebin.com
    main.xml [XML] main.xml - Pastebin.com
    map.xml [XML] map.xml - Pastebin.com

    I am using Eclipse 3.6.2 with Google API level 8 (2.2) emulator, using debug API hash, Manifest has the necessary entries. Any help would be appreciated.


    1. Download the Forums for Android™ app!



Share This Page