• <bdo id='TEfQO'></bdo><ul id='TEfQO'></ul>
  • <i id='TEfQO'><tr id='TEfQO'><dt id='TEfQO'><q id='TEfQO'><span id='TEfQO'><b id='TEfQO'><form id='TEfQO'><ins id='TEfQO'></ins><ul id='TEfQO'></ul><sub id='TEfQO'></sub></form><legend id='TEfQO'></legend><bdo id='TEfQO'><pre id='TEfQO'><center id='TEfQO'></center></pre></bdo></b><th id='TEfQO'></th></span></q></dt></tr></i><div id='TEfQO'><tfoot id='TEfQO'></tfoot><dl id='TEfQO'><fieldset id='TEfQO'></fieldset></dl></div>

        <small id='TEfQO'></small><noframes id='TEfQO'>

      1. <tfoot id='TEfQO'></tfoot>
        <legend id='TEfQO'><style id='TEfQO'><dir id='TEfQO'><q id='TEfQO'></q></dir></style></legend>

        让 AdView 工作

        时间:2023-05-20
          • <small id='gtLl3'></small><noframes id='gtLl3'>

              <tbody id='gtLl3'></tbody>
            <tfoot id='gtLl3'></tfoot><legend id='gtLl3'><style id='gtLl3'><dir id='gtLl3'><q id='gtLl3'></q></dir></style></legend>
            <i id='gtLl3'><tr id='gtLl3'><dt id='gtLl3'><q id='gtLl3'><span id='gtLl3'><b id='gtLl3'><form id='gtLl3'><ins id='gtLl3'></ins><ul id='gtLl3'></ul><sub id='gtLl3'></sub></form><legend id='gtLl3'></legend><bdo id='gtLl3'><pre id='gtLl3'><center id='gtLl3'></center></pre></bdo></b><th id='gtLl3'></th></span></q></dt></tr></i><div id='gtLl3'><tfoot id='gtLl3'></tfoot><dl id='gtLl3'><fieldset id='gtLl3'></fieldset></dl></div>
                <bdo id='gtLl3'></bdo><ul id='gtLl3'></ul>

                1. 本文介绍了让 AdView 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在 libgdx 中开发游戏.我阅读了官方文档并尝试将 MobClix 广告集成到我的应用程序中,但 eclipse 无法解析 ADView 类的此构造函数:(例如):

                  I am developing a game in libgdx. I read the official docs and tried to integrate MobClix Ads in my App but eclipse can't resolve this constructor for ADView class: (for Example):

                   AdView ad = new AdView(this, AdSize.BANNER, "a14d91b10f12454");
                  

                  这行代码给我一个错误.

                  This line of code give me an error.

                  也许我的导入不正确?我导入这个:

                  Maybe my import is not correct? I import this:

                  import com.google.android.gms.ads.AdSize;
                  import com.google.android.gms.ads.AdView;
                  

                  同样的:

                   adView.loadAd(new AdRequest());
                  

                  我试图寻找答案,但我找不到,有人知道如何解决这个问题吗?

                  I tried to search for an answer but I coudn't find, Does somone know how to resolve this?

                  对不起,我的英语不好.

                  Sorry for my poor english.

                  推荐答案

                  把这段代码放到mainactivity中

                  import android.app.Activity;
                  import android.os.Bundle;
                  
                  import com.startapp.android.publish.StartAppAd;
                  
                  public class MainActivity extends Activity {
                  
                  
                      private StartAppAd add = new StartAppAd(this);
                  
                      @Override
                      protected void onCreate(Bundle savedInstanceState) {
                          super.onCreate(savedInstanceState);
                  
                          StartAppAd.init(this, "105158220", "205151606");
                      //StartAppSearch.init(this, "105158220", "205151606");
                          setContentView(R.layout.activity_main);
                  
                      if(add.isReady())
                      {
                          add.showAd(); // show the ad
                          add.loadAd();
                      }   
                          //a.loadAd(AdMode.FULLPAGE);
                  
                      }
                      @Override
                      public void onResume(){
                      super.onResume();
                      add.onResume();
                      }
                  
                      @Override
                      public void onBackPressed() {
                      add.onBackPressed();
                      super.onBackPressed();
                      }
                  
                      @Override
                      public void onPause() {
                      super.onPause();
                      add.onPause();
                      } 
                  
                  }
                  

                  把它放到你的xml文件中

                  put this into your xml file

                  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:tools="http://schemas.android.com/tools"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:paddingBottom="@dimen/activity_vertical_margin"
                      android:paddingLeft="@dimen/activity_horizontal_margin"
                      android:paddingRight="@dimen/activity_horizontal_margin"
                      android:paddingTop="@dimen/activity_vertical_margin"
                      tools:context=".MainActivity" >
                  
                  
                  <com.startapp.android.publish.banner.banner3d.Banner3D
                  android:id="@+id/startApp3DBanner"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentBottom="true"/>
                  </RelativeLayout>
                  

                  把它放到你的 Manifest 文件中

                      <uses-sdk
                          android:minSdkVersion="8"
                          android:targetSdkVersion="18" />
                  
                      <uses-permission android:name="android.permission.INTERNET" />
                      <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
                      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                      <uses-permission android:name="android.permission.READ_PHONE_STATE" />
                      <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
                      <uses-permission android:name="android.permission.GET_TASKS" />
                  
                      <application
                          android:allowBackup="true"
                          android:icon="@drawable/ic_launcher"
                          android:label="@string/app_name"
                          android:theme="@style/AppTheme" >
                          <activity
                              android:name="com.example.start_up_app.MainActivity"
                              android:configChanges="keyboard|keyboardHidden|orientation"
                              android:label="@string/app_name"
                               >
                              <intent-filter>
                                  <action android:name="android.intent.action.MAIN" />
                  
                                  <category android:name="android.intent.category.LAUNCHER" />
                              </intent-filter>
                          </activity>
                          <activity
                              android:name="com.startapp.android.publish.list3d.List3DActivity"
                              android:taskAffinity="com.example.start_up_app.AppWall"
                              android:theme="@android:style/Theme" />
                          <activity
                              android:name="com.startapp.android.publish.AppWallActivity"
                              android:configChanges="orientation|keyboardHidden"
                              android:taskAffinity="com.example.start_up_app.AppWall"
                              android:theme="@android:style/Theme.Translucent" />
                      </application>
                  
                  </manifest>
                  

                  因为你必须使用 StartAppCommon-1.0.1.jar 和 StartAppInApp-2.0.7.jar

                  这篇关于让 AdView 工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 Eclipse 中打开 LibGDX 项目(ADT Bundle) 下一篇:com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件

                  相关文章

                  最新文章

                  <i id='F5tun'><tr id='F5tun'><dt id='F5tun'><q id='F5tun'><span id='F5tun'><b id='F5tun'><form id='F5tun'><ins id='F5tun'></ins><ul id='F5tun'></ul><sub id='F5tun'></sub></form><legend id='F5tun'></legend><bdo id='F5tun'><pre id='F5tun'><center id='F5tun'></center></pre></bdo></b><th id='F5tun'></th></span></q></dt></tr></i><div id='F5tun'><tfoot id='F5tun'></tfoot><dl id='F5tun'><fieldset id='F5tun'></fieldset></dl></div>
                    <bdo id='F5tun'></bdo><ul id='F5tun'></ul>
                2. <tfoot id='F5tun'></tfoot>
                  <legend id='F5tun'><style id='F5tun'><dir id='F5tun'><q id='F5tun'></q></dir></style></legend>

                3. <small id='F5tun'></small><noframes id='F5tun'>