Link to home
Start Free TrialLog in
Avatar of roy_sanu
roy_sanuFlag for India

asked on

Android programming

I have a small snippet of the code how to Change the value MYAPID below from input text field contents
----------------------------------------------------------------------------------------------------------------------------------------
MMAdView interAdView = new MMAdView(this, MYAPID, MMAdView.FULLSCREEN_AD_TRANSITION, true, null);
interAdView.fetch();
interAdView.setListener(new BasicMMAdListener(){
  @Override
  public void MMAdCachingCompleted(MMAdView adview, boolean success)
  {
    if(success)
      adview.display();
  }
});
Avatar of roy_sanu
roy_sanu
Flag of India image

ASKER

Hi,

I am getting error

The constructor MMAdView(new View.OnClickListener(){}, String, String, boolean, null) is undefined, what mistake i am doing
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Button button = (Button) findViewById(R.id.fetchButton);
button.setOnClickListener(new OnClickListener()
      {
      public void onClick(View view)
      {
      EditText text1 = (EditText) findViewById(R.id.editText1);
      String mtext1=text1.getText().toString();
      mtext1 =  apid;
MMAdView fetchCheckDisplayAdView = new MMAdView(this,apid, MMAdView.FULLSCREEN_AD_TRANSITION, true, null);
fetchCheckDisplayAdView.fetch();
fetchCheckDisplayAdView.setListener(new BasicMMAdListener(){
  @Override
  public void MMAdCachingCompleted(MMAdView adview, boolean success)
                          {
                            if(success)
                              adview.display();
                          }
                        });

                        /**** Millennial Media Interstitial Ad Integration ****/
                        
                  //      String myApid = BannerActivity.isTablet(this) ? SampleAppTabActivity.INTERSTITIAL_TABLET_APID : SampleAppTabActivity.INTERSTITIAL_PHONE_APID;
//      myApid = mtext1;
//      fetchCheckDisplayAdView = new MMAdView(this, myApid, MMAdView.FULLSCREEN_AD_TRANSITION, true, BannerActivity.createMetaData());
            //          fetchCheckDisplayAdView.fetch();
            //          fetchCheckDisplayAdView.setListener(new BasicMMAdListener(){
            //           @Override
            //           public void MMAdCachingCompleted(MMAdView adview, boolean success)
            //            {
            //              if(success)
            //               adview.display();
            //                  }
            //                });
                        
                        
                        String message = "Fetching cached ad...";
            //            fetchCheckDisplayAdView.fetch();
                        
                        Log.i(TAG, "Fetch - " + message);
                        Toast toast = Toast.makeText(InterstitialActivity.this, message, Toast.LENGTH_SHORT);
                        toast.show();
                  //      fetchCheckDisplayAdView.fetch();
                        Log.i(TAG, "Fetch2 - " + message);
                        
                  }
                  }      
                  
            });
Thanks Moderator,

Here is the some additional information i would like provide to the expert

I found that if i use this code in the OnCreate Method  it do not  gives the same error, but when Onclick  button is  event it gives me the same  error . Any help will be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of roy_sanu
roy_sanu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial