如何在点击按钮时弹出广告窗口?

问题描述:

  1. 我想在使用android studio单击“阅读更多”按钮时弹出一个广告。该应用程序包含一条信息,如应该点击阅读文章的列表,如果要阅读全文,请阅读更多文章如何在点击按钮时弹出广告窗口?

  2. 然后当用户点击按钮时,广告就会出现,但广告无法关闭广告的按钮被点击

直到uncloseable广告外观是这样的:

the uncloseable ad appearance is like this

  1. 最后当广告已经点击时,用户会被重定向到Play商店或网站,所以用户可以再次返回到应用程序和广告可以关闭
  2. 可关闭广告的外观是这样的:

    the closeable ad appearance is like this

开始=>
+0

创建的透明背景 –

+1

可能的复制全屏对话框[如何做一个简单的Android弹出窗口?](https://*.com/questions/38987442/如何使一个简单的android的弹出式窗口) –

+0

那么请尝试此链接> https://*.com/questions/20258730/custom-dialog-with-close-button –

你需要什么是一个PopupWindow。阅读文档 - https://developer.android.com/reference/android/widget/PopupWindow.html

您可以根据您的要求定制其外观。 类似的查询已经被回答了这里 - How to make a simple android popup window?