la création de CustomInfoWindow dans google map v2

Je vais avoir des problèmes pour créer mon propre CustomInfoWindow. obtenir de l'exception sans savoir où & pourquoi

c'est mon simple customInfoWindow classe

public class CustomInfoWindow implements InfoWindowAdapter {

private LayoutInflater mInflater;

public CustomInfoWindow(LayoutInflater inflater) {
    this.mInflater=inflater;

}


@Override
public View getInfoContents(Marker marker) {
    View popup = mInflater.inflate(R.layout.info_window_layout, null);
    TextView tv=(TextView)popup.findViewById(R.id.title);
    tv.setText(marker.getTitle());
    tv=(TextView)popup.findViewById(R.id.address);
    tv.setText(marker.getSnippet());

    return popup;
}

@Override
public View getInfoWindow(Marker marker) {
    View popup = mInflater.inflate(R.layout.info_window_layout, null);
    TextView tv=(TextView)popup.findViewById(R.id.title);
    tv.setText(marker.getTitle());
    tv=(TextView)popup.findViewById(R.id.address);
    tv.setText(marker.getSnippet());

    return popup;
}

}

Je suis ici. (MainActivity)

mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
            .getMap();
    mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(
            Statics.LAT_TLV, Statics.LON_TLV), 13));

    CustomInfoWindow customInfoWindow = new CustomInfoWindow(getLayoutInflater());
    mMap.setInfoWindowAdapter(customInfoWindow);

Je n'avais pas de mettre en œuvre la onMarkerClick méthode.
la carte des charges ok avec les marqueurs (environ 40), mais quand je clique sur l'un des marqueurs-je obtenir:

    01-10 13:15:24.321: E/AndroidRuntime(21162): FATAL EXCEPTION: main
01-10 13:15:24.321: E/AndroidRuntime(21162): java.lang.NullPointerException
01-10 13:15:24.321: E/AndroidRuntime(21162):    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at android.view.View.measure(View.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.y.i(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.y.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.w.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.bd.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.y.bw.b(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.y.bw.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.dh.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.n.c(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.dw.a(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.bd.c(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.a.dq.onSingleTapConfirmed(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.e.v.onSingleTapConfirmed(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at maps.e.j.handleMessage(Unknown Source)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at android.os.Handler.dispatchMessage(Handler.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at android.os.Looper.loop(Looper.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at android.app.ActivityThread.main(ActivityThread.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at java.lang.reflect.Method.invokeNative(Native Method)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at java.lang.reflect.Method.invoke(Method.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
01-10 13:15:24.321: E/AndroidRuntime(21162):    at dalvik.system.NativeStart.main(Native Method)

apprécierais si quelqu'un peut m'aider avec ça, et si il y a un exemple très simple de la façon de créer votre propre info, il est merveilleux. merci beaucoup. Udi

J'ai exactement la même erreur, si j'utilise getInfoContents tout va bien, mais si j'essaie getInfoWindows, l'application se bloque.

OriginalL'auteur Udi Oshi | 2013-01-10