本文介绍了类要么必须声明为抽象或?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的机器人。我一直使用的片段创建我的应用程序。
所以我复制材料风格抽屉从这里

In this snippet it gives error . I can give image of error

我试图使类抽象的,但随后与OnCreate中捆绑code干扰。任何帮助将是AP preciated

I tried to make the class abstract, but then it interferes with oncreate bundle code. Any help would be appreciated

推荐答案

此消息告诉您,那 RecyclerView.OnItemTouchListener (这是一个接口)定义了一个方法调用 onRequestDisallowInterceptTouchEvent(布尔)。此方法需要每天通过它们实现 OnItemTouchListener 接口的类实现。

This message tells you, that the RecyclerView.OnItemTouchListener (which is an interface) defines a method called onRequestDisallowInterceptTouchEvent(boolean). This method needs to be implemented by every class which implement the OnItemTouchListener interface.

所以只需添加此方法体为空...

So just add this method with an empty body...

@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}

...并且对Java语言界面一看:

这篇关于类要么必须声明为抽象或?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 15:09
查看更多