在我的主要活动中,我遇到了错误:“无法解析符号“ToastAdListener”。所有内容都在我的 AndroidManifest.xml 中声明,并且 Play Services ara 添加到库中。你能告诉我有什么问题吗?
PS。android.widget.Toast 也被导入。
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initialize();
mAdView = new AdView(this);
mAdView.setAdUnitId(getResources().getString(R.string.ad_unit_id));
mAdView.setAdSize(AdSize.BANNER);
mAdView.setAdListener(new ToastAdListener(this)); //here is error
RelativeLayout layout = (RelativeLayout) findViewById(R.id.relLayout);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
layout.addView(mAdView, params);
mAdView.loadAd(new AdRequest.Builder().build());
}