Skip to content

Request: improve full screen native ad sample #934

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

These just don't look well for the full screen native ad sample, as they can often cover important content of the MediaView:

Image Image

Please offer more logical sample for the full screen native ads. The docs show nicer ones:
https://developers.google.com/admob/android/native/full-screen

Maybe offer examples of how to set the MediaView content at the bottom/top/left/right, and have the other UI components around it.
Maybe offer some better on-top UI ?

BTW, trying to change orientation on this sample often causes a crash:

java.lang.NullPointerException: Attempt to read from field 'android.widget.Button com.google.example.gms.fullscreennativeexample.databinding.FragmentMainBinding.showAdButton' on a null object reference in method 'void com.google.example.gms.fullscreennativeexample.MainActivity.lambda$loadAd$5$com-google-example-gms-fullscreennativeexample-MainActivity(com.google.example.gms.fullscreennativeexample.MainFragment, com.google.android.gms.ads.nativead.NativeAd)'
                                                                      	at com.google.example.gms.fullscreennativeexample.MainActivity.lambda$loadAd$5$com-google-example-gms-fullscreennativeexample-MainActivity(MainActivity.java:156)
                                                                      	at com.google.example.gms.fullscreennativeexample.MainActivity$$ExternalSyntheticLambda3.onNativeAdLoaded(D8$$SyntheticClass:0)
                                                                      	at com.google.android.gms.internal.ads.zzbsl.zze(com.google.android.gms:play-services-ads-api@@24.6.0:2)
                                                                      	at com.google.android.gms.internal.ads.zzdip.zzS(com.google.android.gms:play-services-ads@@24.6.0:3)
                                                                      	at com.google.android.gms.internal.ads.zzdin.run(Unknown Source:2)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions