0

I have a listview which some rows are text and some are mapview

I able to select texts but i can't select mapviews

How i setup mapview on adapter:

 /**
     * Initialises the MapView by calling its lifecycle methods.
     */
    public void initializeMapView() {
        if (mapView != null) {
            // Initialise the MapView
            mapView.onCreate(null);
            // Set the map ready callback to receive the GoogleMap object
            mapView.getMapAsync(this);
        }
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        MapsInitializer.initialize(context);
        map = googleMap;
        Message data = (Message) mapView.getTag();
        if (data != null) {
            setMapLocation(map, data);
        }
    }
}

I also tried below solutions:

 googleMap.getUiSettings().setZoomControlsEnabled(false);
        googleMap.getUiSettings().setCompassEnabled(false);
        googleMap.getUiSettings().setMyLocationButtonEnabled(false);
        googleMap.getUiSettings().setRotateGesturesEnabled(false);
        googleMap.getUiSettings().setMapToolbarEnabled(false);
        mapView.setClickable(false);

But does not works, what is the problem? and how can i fix it?

Thanks in advance,

Mostafa Jamareh
  • 1,389
  • 4
  • 22
  • 54
  • `mapView.setClickable(false);` will make the map not clickable. Do you want to click the List or the Map? – zgc7009 May 04 '16 at 13:23
  • thank you, i know that but as i said i tried that – Mostafa Jamareh May 04 '16 at 13:24
  • This is not a soln. But, can u read [this](http://stackoverflow.com/questions/2961275/android-mapview-contained-within-a-listview) one which has 40 upvotes. Might help you. – Raghavendra May 04 '16 at 13:28
  • That isn't what I am saying, I am saying if you want to make your map clickable, that won't do it. If you want to make your list item clickable handle that via your adapter's onItemClickListener. – zgc7009 May 04 '16 at 13:31
  • i handle listener on adapter and i can select texts but i cant select maps – Mostafa Jamareh May 04 '16 at 13:35

0 Answers0