将 Google 广告横幅添加到我的 Android-Studio 项目不起作用。如果有人可以帮助我,我将非常感激。我只是不明白我做错了什么。:/我遵循的教程是:https : //www.youtube.com/watch?v=w7muIkMYE_A
编辑:现在我稍微更改了代码并出现了新错误。安卓清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.codereddev.howtoandroidsoundboard">
...
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!--
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"/>
-->
<meta-data
android:name ="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity
android:name=".SoundboardActivity"
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=".FavoriteActivity" />
<!-- Necessary for sharing sounds on Android 5.1+ -->
<provider
android:authorities="${applicationId}.fileprovider"
android:name="android.support.v4.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
</provider>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
我的 SoundboardActivity 类没有变化:
public class SoundboardActivity
extends AppCompatActivity implements
LoaderManager.LoaderCallbacks<ArrayList<SoundObject>> {
AdView mAdview;
...
@Override
protected void …Run Code Online (Sandbox Code Playgroud)