private boolean canUseThisAd ( NativeAd adNative ) { if ( adNative != null ) { NativeAd . Image logoImage = null ; CharSequence header = null , body = null ; if ( adNative instanceof NativeContentAd ) { NativeContentAd ad = ( NativeContentAd ) adNative ; logoImage = ad . getLogo ( ) ; header = ad . getHeadline ( ) ; body = ad . getBody ( ) ; } else if ( adNative instanceof NativeAppInstallAd ) { NativeAppInstallAd ad = ( NativeAppInstallAd ) adNative ; logoImage = ad . getIcon ( ) ; header = ad . getHeadline ( ) ; body = ad . getBody ( ) ; } if ( ! TextUtils . isEmpty ( header ) && ! TextUtils . isEmpty ( body ) ) { return true ; } } return false ; }
Determines if the native ad can be used .