I am working on small project and i stuck on banner ads implementation. When i place admob ad below to bottom then alert functionality will loose it working means when we click on screen in any corner then this layout will working like dialog but when i add another layout inside this i implement banner adview below then this functionality is not working and i forcefully click the back button to exit the app. I will give small clip for the same in below so that you can understand batter to resolve my issue.
This is my theme.xml
<style name="Transparent" parent="Theme.AppCompat.Light.Dialog">
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="windowActionBar">false</item>
</style>
This is my layout xml:-
<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:background="#00212121"
tools:context=".MainActivity">
<LinearLayout
//some code here
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView>
</LinearLayout>
</RelativeLayout>
This is my manifest:
<activity android:name=".Custom_Settings"
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar" />
<activity
android:name=".MainActivity"
android:theme="@style/Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This is my java :-
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
Now if you all not understand this above question then see this two snap this will give you an idea how to resolve this problem.