Ok, I've been at this all day now, I give up trying to get this myself!
I've declared the map and location
private GoogleMap googleMap;
declared the location
static final LatLng SECC = new LatLng(55.8607,-4.2871);
generated the map
googleMap=((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
built the marker
Marker secc =googleMap.addMarker(new MarkerOptions().position(SECC)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))
.title("SECC").snippet("Exhibition Way, Glasgow, G3 8YW\nSports: Boxing, Gymnastics, Judo, Netball, Wrestling, Weightlifting"));
set the on click listener to the map
googleMap.setOnMarkerClickListener((OnMarkerClickListener)this);
set up the custom info box
googleMap.setInfoWindowAdapter(new InfoWindowAdapter()
{
@Override
public View getInfoWindow(Marker arg0)
{
return null;
}
public View getInfoContents(Marker marker)
{
View v = getLayoutInflater().inflate(R.layout.marker,null);
TextView info=(TextView) v.findViewById(R.id.info);
info.setText("hello");
return v;
}
});
and set up the click event
googleMap.setOnMarkerClickListener(new OnMarkerClickListener()
{
@Override
public boolean onMarkerClick(Marker marker)
{
marker.showInfoWindow();
return true;
}
});
Can anyone point out where I'm going wrong? The map loads and you can click on a marker to get a snippet but the custom info isn't displaying
edit to include manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.muc_coursework"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<permission
android:name="org.me.myandroidstuff.mapstuff.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<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="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.muc_coursework.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBFL6EfXODsfCxqyNktI5k9m03rygILej4"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>