gpt4 book ai didi

android - Google 因后台广告暂停了我的应用

转载 作者:行者123 更新时间:2023-11-29 15:57:05 24 4
gpt4 key购买 nike

<分区>

昨天谷歌暂停了我在谷歌商店的应用程序,说我的广告违反了谷歌服务条款。基本上有一种错误,显然是我的错,在某些设备中,如果您按下主页按钮并让应用程序进入后台,广告也会继续显示。我真的不知道如何解决它。

这是xml代码

<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="INTERSTITIAL"
ads:adUnitId="MyID" >
</com.google.android.gms.ads.AdView>

这是主要的

public class MainActivity extends ActionBarActivity 
{
private WebView webView;
private InterstitialAd interstitial;
String Url="Myurl";
List<String> segments = new ArrayList<String>();
int delay = 120000; //milliseconds

@Override
protected void onCreate(Bundle savedInstanceState)
{

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run()
{
//advertise();
handler.postDelayed(this, delay);
}
}, 7000);
//
}



public void advertise()
{
// Prepare the Interstitial Ad
interstitial = new InterstitialAd(MainActivity.this);
// Insert the Ad Unit ID
interstitial.setAdUnitId("MyID");

//Locate the Banner Ad in activity_main.xml
AdView adView = (AdView) this.findViewById(R.id.adView);

// Request for Ads
AdRequest adRequest = new AdRequest.Builder()

// Add a test device to show Test Ads
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("CC5F2C72DF2B356BBF0DA198")
.build();

// Load ads into Banner Ads
adView.loadAd(adRequest);

// Load ads into Interstitial Ads
interstitial.loadAd(adRequest);

// Prepare an Interstitial Ad Listener
interstitial.setAdListener(new AdListener()
{
public void onAdLoaded() {
// Call displayInterstitial() function
displayInterstitial();
}
});
}
public void displayInterstitial()
{
// If Ads are loaded, show Interstitial else show nothing.
if (interstitial.isLoaded())
{
interstitial.show();
}
}*/

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId())
{
case R.id.twitter:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/salvoaranzulla"));
startActivity(browserIntent);
break;
case R.id.facebook:
Intent browserIntent1 = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/salvoaranzulla?ref=ts&fref=ts"));
startActivity(browserIntent1);
break;
}
return true;
}

}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com