【发布时间】:2021-05-31 03:22:13
【问题描述】:
-
setSupportActionBar(工具栏);
-
((Activity)context).setSupportActionBar(toolbar);
我以不同的方式尝试了很多次,但都显示错误。
任何人,请向我提出一个在适配器中使用它的想法。
【问题讨论】:
-
为什么要在适配器中使用它?为什么不能更新活动?
-
因为我没有使用Activity,我想在Layout中通过Adapter来设置。
-
您应该使用 Activity/Fragment 来固定适配器吗?
标签: android android-studio android-adapter