升级到appcompat后,25.1.0我开始收到有线错误.
在我的代码中:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Run Code Online (Sandbox Code Playgroud)
我得到lint错误:
AppCompatActivity.onCreate can only be called from within the same library group (groupId=com.android.support)
如何防止这种行为?
我用这个代码
ActionMenuItemView item = (ActionMenuItemView) findViewById(R.id.my_item_id);
item.setTitle("Test String");
Run Code Online (Sandbox Code Playgroud)
并得到错误
ActionMenuItemView.setTitle只能在同一个库组中调用(groupId = com.android.support)
我使用Android SDK 27激活了Java 8支持.我发现的所有相关问题都是以前版本的旧Android版本中的错误.但我使用最新的一个.
无论如何,该应用程序运行.但是如何摆脱这个错误而不仅仅是压制它呢?
我有一个包含 2 个或更多查看者的 recyclerview,
CalendarView——全部在一个 viewhodler 中。问题是 CalendarView 的高度相当大,当 CalendarView 稍微离开屏幕并且我折叠/消失日历时,它会折叠但仍然占用空间,就像下面的屏幕截图一样。但奇怪的是,它只发生在Android 8 & 9.
初始屏幕截图:
问题截图(折叠简历后):
Viewholder 项目的 ClickListener:
val clickListener = View.OnClickListener {
// irrelevant code //
for (type in AllOptionsEnum.values()) {
// Expand Selected and Collapse Others
val detailView = this.root.findViewById<ViewGroup>(type.detailViewGroupId)
val labelView = this.root.findViewById<TextView>(type.labelViewId)
val checkBox = this.root.findViewById<CheckBox>(type.checkBoxId)
if (detailView.visibility == View.VISIBLE) {
// hide detailed view
detailView.setVisible(show = false)
checkBox.isChecked = false
} else { …Run Code Online (Sandbox Code Playgroud)