java 方法只能从同一个库组中调用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47585182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:41:14  来源:igfitidea点击:

Method can only be called from within the same library group

javaandroid

提问by juergen d

I use this code

我用这个代码

ActionMenuItemView item = (ActionMenuItemView) findViewById(R.id.my_item_id);
item.setTitle("Test String");

and get the error

并得到错误

ActionMenuItemView.setTitle can only be called from within the same library group (groupId=com.android.support)

ActionMenuItemView.setTitle 只能从同一个库组内调用 (groupId=com.android.support)

I use the Android SDK 27 with Java 8 support activated. All related issues I found were bugs in previous releases of older Android versions. But I use the latest one.

我使用已激活 Java 8 支持的 Android SDK 27。我发现的所有相关问题都是旧版 Android 版本中的错误。不过我用的是最新的。

The app runs though anyway. But how to get rid of that error without only suppressing it?

无论如何,该应用程序仍在运行。但是如何摆脱那个错误而不只是抑制它呢?

回答by Manie Besselaar

this link

这个链接

helped me out.

帮了我。

It seems that the FloatingActionButton was move to a new package and now uses the .show() and .hide() methods instead of setVisibility().

似乎 FloatingActionButton 被移动到一个新包,现在使用 .show() 和 .hide() 方法而不是 setVisibility()。

The post applies to Kotlin, but the method names are the same for Java.

该帖子适用于 Kotlin,但 Java 的方法名称相同。

Hope this helps someone out there.

希望这可以帮助那里的人。