Solution 1 :
You add a Toast.Callback to the Toast. Assuming that you already know how to show your admob videos:
Toast t = Toast.makeText(context, "You Win ! Play Next Level", Toast.LENGTH_LONG);
t.addCallback(new Toast.Callback() {
@Override
public void onToastShown() {
super.onToastShown();
// show admob when toast is shown
}
@Override
public void onToastHidden() {
super.onToastHidden();
// show admob when toast disappears
}
});
t.show();
Reference: https://developer.android.com/reference/android/widget/Toast.Callback
Solution 2 :
static final long SHORT_DURATION_TIMEOUT = 4000;
static final long LONG_DURATION_TIMEOUT = 7000;
These are the values of the Short & Long Text 4seconds and 7 seconds ,
You can Trigger your video ad after this Duration.
Problem :
If a user win Puzzle Game Level than I make a Toast “You Win Play Next Level” and then I want to show rewarded video ads.
What code will be there to show Admob Rewarded Video Ads after Toast in android studio?
if (isSolved())
Toast.makeText(context, "You Win ! Play Next Level", Toast.LENGTH_LONG).show();
Comments
Comment posted by Akash Tongare
if (isSolved()) This is in private static void