rubensousa / GravitySnapHelper

A SnapHelper that snaps a RecyclerView to an edge.
Apache License 2.0
5k stars 614 forks source link

java.lang.IllegalStateException: An instance of OnFlingListener already set. #46

Closed chnouman closed 6 years ago

chnouman commented 6 years ago

Adding Snaps dynamicaly and notifyDataSetChanged gives this above error what i'm doing so far is

 //add three more items
            progressBar.setVisibility(View.VISIBLE);
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {

                    List<App> apps = getApps();
                    snapAdapter.addSnap(new Snap(Gravity.CENTER_HORIZONTAL, "Paper Industry", apps));
                    snapAdapter.addSnap(new Snap(Gravity.CENTER_HORIZONTAL, "Wood Industry", apps));
                    snapAdapter.addSnap(new Snap(Gravity.CENTER_HORIZONTAL, "Cement Industry", apps));
                    snapAdapter.notifyDataSetChanged();
                    progressBar.setVisibility(View.GONE);
                }
            },3000);
chnouman commented 6 years ago

@SUPERCILEX can you please help

chnouman commented 6 years ago

@rubensousa

chnouman commented 6 years ago

sorry that was due to my mistake.