Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9078751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:42:10+00:00 2026-06-16T19:42:10+00:00

I’m trying to make application where user has an option to click on button

  • 0

I’m trying to make application where user has an option to click on button “Find on Map”.
If user clicks “Find on Map” button, I would like to start new activity that contains google map.

I did this tutorial and map shows.
http://mobiforge.com/developing/story/using-google-maps-android

However this tutorial shows map in the main activity. That is why I made ViewMap activity which is exactly the same as the main activity in the tutorial showed above.
This is how I start ViewMap activity:

  findOnMapButton.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {

        // create an Intent to launch the ViewMap Activity
             Intent viewMap = new Intent(ViewCourse.this, ViewMap.class);
             startActivity(viewMap); // start the ViewContact Activity

            }
        });

Here is ViewMap.java:

    package com.ijankovic.exammanager;

    import android.os.Bundle;
    import com.google.android.maps.GeoPoint;
    import com.google.android.maps.MapActivity;
    import com.google.android.maps.MapController;
    import com.google.android.maps.MapView;

    public class ViewMap extends MapActivity {

private MapView mapView;
    private MapController mc;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.view_map);


     mapView = (MapView) findViewById(R.id.mapview);
     mc = mapView.getController();

     String coordinates[] = {"31.567615", "74.360962"};
     double lat = Double.parseDouble(coordinates[0]);
     double lng = Double.parseDouble(coordinates[1]);

     GeoPoint p = new GeoPoint(
     (int) (lat * 1E6),
     (int) (lng * 1E6));

    mc.animateTo(p);
     mc.setZoom(7);
     mapView.invalidate();
}

@Override
protected boolean isRouteDisplayed() {
    return false; // we are not displaying route information
}
}

Here is view_map.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

    <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="0jHJ3aWhSfOMZ1gjFMGc8xTf7mASBEtQcynZPOQ"
        android:clickable="true"
        android:enabled="true" />

    </RelativeLayout>

I know my API key works for sure since map displays if I put ViewMap as the main activity.
However if I try to put it in activity that gets called on button clicked, map opens but everything is grey and tiles do not load. There is Google logo in the bottom left corner.

Here is my manifest file:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.ijankovic.exammanager"
        android:versionCode="1"
        android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="10" />

<uses-permission android:name="android.premission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <activity
            android:name="com.ijankovic.exammanager.MainActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        </activity>
        <activity android:name=".ViewCourse"
            android:label="@string/app_name"></activity>
        <activity android:name=".ViewMap"
            android:label="@string/app_name"></activity>

        <uses-library android:name="com.google.android.maps" />
    </application>
</manifest>

Problem:

Is something wrong with my Intent and ViewMap activity call?

Any suggestions are welcome. Thanks in advance!

Edit:

I managed to get google maps with this call:

    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=New+York+NY)); 
    startActivity(i);

However this seems to start google maps app. It is not google maps within my app like the tutorial showed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:42:12+00:00Added an answer on June 16, 2026 at 7:42 pm

    I figured out what the problem was!

    What I had:

        <uses-permission android:name="android.premission.INTERNET" />
    

    What it should be:

        <uses-permission android:name="android.permission.INTERNET" />
    

    So I typed premission instead of permission.
    I’m surprised that eclipse does not point syntax errors in AndroidManifest.xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.