Go to Your Activity and create the onClicked handler for the Reward Video button:
JAVA:
public void rewardVideo(View view) {
String url="https://js.appcdn.net/Android-test-1.html";//TODO:ADD YOUR URL
WebViewApplixir webViewApplixir=new WebViewApplixir(this, url);
setContentView(webViewApplixir);
webViewApplixir.showAds(new WebViewApplixir.OnCompleteAdListener() {
@Override
public void statusCallBack(String status) {
if(status.contains("sys-closing")) { //AD CLOSED
//TODO: Handle when the ad display closes. You can move the user to another
//screen or give them something to continue playing
//Example: Start another activity after the ad is closed
// startActivity(new Intent(MainActivity.this, GameActivity.class));
//Example: Add finishAffinity if moving user from one screen to another
// finishAffinity();
//Example: If you are still in the same activity use this instead
//setContentView(R.layout.activity_main);
}
}
});
}
KOTLIN:
fun rewardVideoKotlin(view: View?) {
val url = "https://js.appcdn.net/Android-test-1.html" //TODO:ADD YOUR URL
val webViewApplixirKotlin = WebViewApplixirKotlin(this, url)
setContentView(webViewApplixirKotlin)
webViewApplixirKotlin.showAds (object :WebViewApplixirKotlin.OnCompleteAdListener{
override fun statusCallBack(status: String?) {
Log.d("status",status!! )
if (status == "sys-closing") { //AD CLOSED
// TODO: Handle when the ad display closes. You can move the user to another
// screen or give them something to continue playing
// Example Start another activity after the ad is closed
startActivity(Intent(this@MainActivityKotlin, GameActivity::class.java))
// Example: Use finish infinity if moving user from one screen to another
finishAffinity()
//Example: if you are still in the same activity use this instead:
//setContentView(R.layout.activity_main);
}
}
})
}