cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

setEmptyView issue #166

Closed Swisyn closed 9 years ago

Swisyn commented 9 years ago

when i try to change empty_view of recyclerview which is set in xml, it gives that error;

java.lang.IllegalStateException: ViewStub must have a non-null ViewGroup viewParent at android.view.ViewStub.inflate(ViewStub.java:292) at com.marshalchen.ultimaterecyclerview.UltimateRecyclerView.setEmptyView(UltimateRecyclerView.java:183)

in both codes; getUltimateRecyclerView().setEmptyView(getResources().getIdentifier("empty_favorites","layout",getActivity().getPackageName())); getUltimateRecyclerView().setEmptyView(R.layout.empty_favorites);

is there way to change empty_view dynamically?

cymcsg commented 9 years ago

As ViewStub can only inflate once, it's hard to change empty_view dynamically unless change ViewStub to View.