Solved

Android programming

Posted on 2012-12-27
5
478 Views
Last Modified: 2013-11-21
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();
  }
});
0
Comment
Question by:roy_sanu
  • 3
5 Comments
 

Author Comment

by:roy_sanu
ID: 38731943
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);
                        
                  }
                  }      
                  
            });
0
 

Author Comment

by:roy_sanu
ID: 38735580
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.
0
 

Accepted Solution

by:
roy_sanu earned 0 total points
ID: 38739155
Moderator,

Pls close the question as i got the answer for it.

Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now