Marker Cluster, clusterManager.clearItem() Doesn't clear nothing

403
December 29, 2016, at 10:35 AM

I've tried for an hour but nothig, I have to clear my cluster manager befor I repopulate my map

Here the code of the cluster manager and the clear portion, it's a postExcecute of a retrofit GET

 ClusterManager mClusterManager = new ClusterManager<>(getApplicationContext(), mMap);
        mMap.setOnCameraChangeListener(mClusterManager);
        // Add cluster items (markers) to the cluster manager.
        mClusterManager.setRenderer(new ClusterRender(getApplicationContext(),mMap,mClusterManager));
        /*final String TAG = User.class.getSimpleName();
        if(marker.size()>1&!marker.equals(null)){
            int m=0;
            while(m<marker.size()){
                Log.d(TAG, marker.get(m).getTitle()+"");
                Log.d(TAG, mClusterManager.toString());
                mClusterManager.removeItem(marker.get(m));
                m++;
            }
            marker.clear();
        }*/
        mClusterManager.clearItems();
        mClusterManager.cluster();
        mMap.clear();
        marker.clear();
        // Setting the position of the marker
       if(path.size()>0) {
           int l=0;
           while(l<path.size()) {
               marker.add(new MyItem(path.get(l).latitude, path.get(l).longitude,stitolo.get(l)));
               //Toast.makeText(Main.this, offsetItem.getTitle(), Toast.LENGTH_SHORT).show();
               if(!marker.get(l).equals(null)) {
                   mClusterManager.addItem(marker.get(l));
               }
               l++;
           }
           mClusterManager.cluster();
       }
    }

The portion in the comment is another try I made, but it give

java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.remove(java.lang.Object)' on a null object reference

on "mClusterManager.removeItem(marker.get(m));"

READ ALSO
Text fade-in with Transition Manager not working with RecyclerView

Text fade-in with Transition Manager not working with RecyclerView

I have a fragment holding a recyclerview, and when I tap on an item I want the textviews within it to fade out for a scene transition into an ActivityWhen I hit the back button to go back to the fragment, the text in the recyclerview item should fade back in

398
Updating TextView and running Animation on rows in RecyclerView is causing memory leak

Updating TextView and running Animation on rows in RecyclerView is causing memory leak

In our application, we have recyclerviews with many rows in themEach one has a TextView whos text is a timestamp representing how long the row has been there, as well as an ImageView that may or may not need to be animated based on the item the row corresponds...

364
(android) Hidng actionbar/toolbar smoothly?

(android) Hidng actionbar/toolbar smoothly?

I'm making and publishing a web application which contains android web viewAt enhancing my app, I tried to implement that when user scrolls web view, action bar disappears

406
Android - ACTION_POINTER_UP not called until movement of remaining touch

Android - ACTION_POINTER_UP not called until movement of remaining touch

Whilst trying to debug a multi-touch issue, I ended up stripping my onTouchEvent code right down to see what was going on, and found the following issueAm I missing something? Cheers in advance!

337