Issue
XML (activity_maptest.xml):
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
Java (Maptest.java):
package com.example.app;
import android.app.Activity;
import android.os.Bundle;
public class Maptest extends Activity {
public class MapActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maptest);
}
}
}
Manifest:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
.
.
.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
android:allowBackup="true"
android:icon="@drawable/icon_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
.
.
.
<activity
android:name="com.example.app.Maptest"
android:label="@string/title_activity_maptest" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY ACTUAL KEY" />
</application>
When this page is loaded in my page is just white and there are no errors LogCat. I was following the google guide: https://developers.google.com/maps/documentation/android/start, but it appears I did something wrong?
Solution
You have an Activity inside an Activity. Try removing one of them
Answered By - Emmanuel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.