Madvertise on Load

时间:2011-11-05 20:25:51

标签: android eclipse

嘿伙计们,我在我的活动中得到了这段代码:

public class MYAppActivity extends Activity{
/** Called when the activity is first created. */
 private MadvertiseView mMadView;
 private AdView mAdmView;

@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);      

    mAdmView = (AdView)findViewById(R.id.admad);
    mMadView = (MadvertiseView)findViewById(R.id.madad);


}

     @Override
     public void onLoaded(boolean succeed, MadvertiseView  mMadView) {
     if (succeed) {
     // ad loaded, set view visible
     Log.d("YOUR_LOG_TAG", "Ad successfully loaded");
     mMadView.setVisibility(View.VISIBLE);
     } else {
     // ad could not be loaded, set view to invisible
     Log.w("YOUR_LOG_TAG", "Ad could not be loaded");
     mMadView.setVisibility(View.INVISIBLE);}
     }

我得到这个错误:MYAppActivity类型的onLoaded(boolean,MadvertiseView)方法必须覆盖或实现超类型方法通用/ src / de / ollidiemaus / MYApp第58行Java问题

你们中的任何人都知道我的应用程序出了什么问题? 我使用了最新的madvertise sdk

2 个答案:

答案 0 :(得分:0)

尝试添加此行:     super.onLoaded(成功,mMadView) 在if声明之前。可能会有所帮助。您的代码将如下所示:

 public void onLoaded(boolean succeed, MadvertiseView  mMadView) {
 if (succeed) {
 // ad loaded, set view visible
 Log.d("YOUR_LOG_TAG", "Ad successfully loaded");
 mMadView.setVisibility(View.VISIBLE);
 } else {
 // ad could not be loaded, set view to invisible
 Log.w("YOUR_LOG_TAG", "Ad could not be loaded");
 mMadView.setVisibility(View.INVISIBLE);}
 }

答案 1 :(得分:0)

我不明白为什么在没有让你的活动实现特定的adview界面时重写onloaded,也没有将监听器设置为this。您的adview现在如何调用该方法?