java - 如何将类(class)更改为公开类(class)?

标签 java eclipse class public

如何将类更改为公共(public)类并消除此消息?

Description Resource    Path    Location    Type
This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView) BootleJFL       line 1  Android Lint Problem

最佳答案

这将是 Android Lint Checks

可实例化

Summary: Ensures that classes registered in the manifest file are instantiatable

  • Priority: 6 / 10
  • Severity: Warning
  • Category: Correctness

Activities, services, broadcast receivers etc. registered in the manifest file must be "instiantable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class.

确保您的 v7-appcompat 库将其设置设置为“警告”(或“忽略”)。

关于java - 如何将类(class)更改为公开类(class)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24968622/

相关文章:

eclipse - 如何增加 Eclipse 输出控制台的容量?

c++ - 来自自定义类的对象 vector

java - 随机 HSV 颜色

java - 使用 Java 在 OpenCL 上运行 C 应用程序 - 可能吗?

java - 我应该如何在浏览器中的 Spring Boot 中执行 SQL 查询

java - 在不断计算更高值并将其存储在磁盘上的系统中,存储要求何时会超过 RAM?

java - Eclipse 远程调试不适用于伪分布式模式下的 hadoop

java - TableViewer 单元格编辑器不工作 - SWT

scala - `super` 是否静态绑定(bind)在类中?

c# - 为 C# 中的类扩展简单的 getter、setter 方法