সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
public abstract class InterstitialAd
AdManagerInterstitialAd | Google Ad Manager প্রকাশকদের জন্য একটি পৃষ্ঠা পরিবর্তন, একটি অ্যাপ লঞ্চ বা একটি গেম লেভেল লোডের মতো প্রাকৃতিক পরিবর্তনের পয়েন্টগুলিতে একটি সম্পূর্ণ পৃষ্ঠা বিজ্ঞাপনের অভিজ্ঞতা। |
একটি পৃষ্ঠা পরিবর্তন, একটি অ্যাপ লঞ্চ, বা একটি গেম লেভেল লোডের মতো প্রাকৃতিক পরিবর্তনের পয়েন্টগুলিতে একটি সম্পূর্ণ পৃষ্ঠা বিজ্ঞাপনের অভিজ্ঞতা৷ ইন্টারস্টিশিয়ালগুলি একটি বন্ধ বোতাম ব্যবহার করে যা ব্যবহারকারীর অভিজ্ঞতা থেকে বিজ্ঞাপনটিকে সরিয়ে দেয়৷
নমুনা কোড:
public class MyActivity extends Activity {
private InterstitialAd interstitialAd;
private Button nextLevelButton;
private TextView textView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create a full screen content callback.
FullScreenContentCallback fullScreenContentCallback = new FullScreenContentCallback() {
@Override
public void onAdDismissedFullScreenContent() {
interstitialAd = null;
// Proceed to the next level.
goToNextLevel();
}
};
// Load an interstitial ad. When a natural transition in the app occurs (such as a level
// ending in a game), show the interstitial. In this simple example, the press of a
// button is used instead.
//
// If the button is clicked before the interstitial is loaded, the user should proceed to
// the next part of the app (in this case, the next level).
//
// If the interstitial is finished loading, the user will view the interstitial before
// proceeding.
InterstitialAd.load(
this,
"myAdUnitId",
new AdRequest.Builder().build(),
new InterstitialAdLoadCallback() {
@Override
public void onAdLoaded(@NonNull InterstitialAd ad) {
interstitialAd = ad;
interstitialAd.setFullScreenContentCallback(fullScreenContentCallback);
}
@Override
public void onAdFailedToLoad(@NonNull LoadAdError adError) {
// Code to be executed when an ad request fails.
}
});
// Create the button to go to the next level.
nextLevelButton = new Button(this);
nextLevelButton.setText("Next Level");
nextLevelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Show the interstitial if it is ready. Otherwise, proceed to the next level
// without ever showing it.
if (interstitialAd != null) {
interstitialAd.show(MyActivity.this);
} else {
// Proceed to the next level.
goToNextLevel();
}
}
});
// Add the next level button to the layout.
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
layout.addView(nextLevelButton);
// Create a TextView to display the current level.
textView = new TextView(this);
textView.setText("Level 1");
layout.addView(textView);
setContentView(layout);
}
public void goToNextLevel() {
// Show the next level, and disable the next level button since there are no more levels.
nextLevelButton.setEnabled(false);
textView.setText("Level 2");
}
}
সারাংশ
পাবলিক পদ্ধতি
public abstract void setImmersiveMode(boolean immersiveModeEnabled)
একটি পতাকা সেট করে যা নিয়ন্ত্রণ করে যে এই ইন্টারস্টিশিয়াল অবজেক্টটি ইমারসিভ মোডে প্রদর্শিত হবে কিনা। show
আগে এই পদ্ধতিতে কল করুন। show
চলাকালীন, যদি এই পতাকাটি চালু থাকে এবং ইমারসিভ মোড সমর্থিত হয়, তাহলে ইন্টারস্টিশিয়াল বিজ্ঞাপনের জন্য SYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION চালু করা হবে৷
public abstract void show(@NonNull Activity activity)
ইন্টারস্টিশিয়াল বিজ্ঞাপন দেখায়।
পরামিতি |
---|
@ NonNull Activity activity | একটি Activity প্রসঙ্গ যেখান থেকে বিজ্ঞাপনটি উপস্থাপন করতে হবে৷ |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-06-09 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-06-09 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[]]