I want to display an ad when the user presses the back button for which I am using the following code:
The problem is that the app closes before the ad can be displayed properly.
Is there a way to let the app exit only when the ad gets displayed and is cancelled?
B4X:
Sub Activity_KeyPress(KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
ad2.loadAd()
End If
End Sub
The problem is that the app closes before the ad can be displayed properly.
Is there a way to let the app exit only when the ad gets displayed and is cancelled?