我正在尝试设置自定义EmptyView
。
使用:
@Override
protected void initCard(){
View empty view = getView() //inflate the empty view, bind views and return
setEmptyView(view);
}
我得到了一个NullPointerException
,因为 LinerListView 尚未实例化。
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void it.gmariotti.cardslib.library.prototypes.LinearListView.setVisibility(int)' on a null object reference
at it.gmariotti.cardslib.library.prototypes.CardWithList.updateEmptyStatus(CardWithList.java:656)
at it.gmariotti.cardslib.library.prototypes.CardWithList.setEmptyView(CardWithList.java:631)
运行后尝试设置 emptyView 时,myCard.init()
我得到默认的EmptyView:
myCard.init();
myCardView.setCard(myCard);
myCard.setEmptyView(myEmptyView);
有什么办法吗?