我在另一个页面上使用了谷歌浏览器,但我想使用fb受众网络横幅广告,但它显示错误。我的代码是:
adView = new AdView(BhaktiPlayer.this, "539967309761431_541729399585222", AdSize.RECTANGLE_HEIGHT_250);
// Find the Ad Container
LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container);
// Add the ad view to your activity layout
adContainer.addView(adView);
// Request an ad
adView.loadAd();
并显示错误:
Error:(57, 48) error: incompatible types: String cannot be converted to AttributeSet
Error:(64, 15) error: method loadAd in class BaseAdView cannot be applied to given types;
required: AdRequest
found: no arguments
reason: actual and formal argument lists differ in length
你可能需要命令notifyDataSetChanged();
你有没有看过that?
RecyclerView
不提供默认更新方法,由您自己每次调用它,这为您提供了更大的灵活性。
正如帖子解释的那样,您需要将方法调用到更新视图的适配器中
public void updateData(ArrayList<ViewModel> viewModels) {
items.clear();
items.addAll(viewModels);
notifyDataSetChanged();
}
当您从firebase手动更改任何内容时,它将不会在您的应用程序中生效,因为您的应用程序不知道您手动完成的操作,除非您从代码中执行此操作。如果你从代码中执行它,那么notifyDataSetChanged()就是你的方法。