MoPubAdAdapter with GridView



Hello there, I have been trying to integrate the mopub native ads in our android app, our app uses a GridView to show the content and MoPubAdAdapter to show native ads in between the content, the issue I am having is that if a user clicks on an item, the adapter is returning its position wrong, I looked at the code of MoPubAdAdapter and it provides an setOnClickListener Function, but that only accepts a ListView and a listener, and no gridview, same is the case with rest of the functions in that class, like setSelection etc, Please let me know how can I fix this issue, I surely don’t want to edit the sdk and looking for a genuine solution.



Hello tilalHusain,

Please use MoPubStreamAdPlacer instead of MoPubAdAdapter. This will configure native ads correctly in a GridView.

Let us know if you have any questions or if this issue persists.