这是我的 chartboost Mainactivity.java 类代码
// Configure Chartboost
this.cb = Chartboost.sharedChartboost();
String appId = "52f48e072d42da4746c0d6e9";
String appSignature = "4198d0da78055b13dc80fc937c1df8b44a498927";
this.cb.onCreate(this, appId, appSignature, null);
// Show an interstitial
this.cb.showInterstitial();
@Override
protected void onStart() {
super.onStart();
this.cb.onStart(this);
// Notify the beginning of a user session. Must not be dependent on user actions or any prior network requests.
this.cb.startSession();
// Show an interstitial
this.cb.showInterstitial();
}
@Override
protected void onStop() {
super.onStop();
this.cb.onStop(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
this.cb.onDestroy(this);
}
@Override
public void onBackPressed() {
// If an interstitial is on screen, close it. Otherwise continue as normal.
if (this.cb.onBackPressed())
return;
else
super.onBackPressed();
}
我还在我的 libs 文件夹中包含了 chartboost.jar,并且还在 gradle 中添加了依赖项。
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile files ('libs/jsoup-1.7.3.jar')
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
compile files('libs/chartboost.jar')
}
还在 androidManifest.xml 中添加活动,即
<activity android:name="com.chartboost.sdk.CBImpressionActivity"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
但是当我启动我的添加时,它只是显示强制关闭。请帮我。提前谢谢。