Hello guys...
I have source code for application
When I change the code of admob
My ads are not showing.
What's a problem?
enter image description here
From what I can see, your XML is the problem. You have a RelativeLayout nested inside of a ConstraintLayout. This is never a good idea. The whole point of ConstraintLayout is to be able to make a flat layout tree, instead of nested layouts. Second, the biggest problem I can see is your FrameLayout has a height of match_parent. This is going to overlap your adview, and so your ad will never be visible.
So, what I suggest, first, remove the relative layout, then, make constraints so the bottom of your frame doesn't overlap your ad. I would also change the height to wrap_content, so it will fill the view, but not overlap.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:id="@+id/view">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/fragment1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
app:layout_constraintBottom_toTopOf="@id/adView"/>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
ads:adSize="BANNER"
ads:adUnitId="@string/admob_publisher_id" />
</android.support.design.widget.CoordinatorLayout>
I didn't take the time to fill in all of the constraints (you have to do some of it for yourself!), but this constraint will get you started. Learn what the constraints do. It can make for much better layouts that are very flexible.