Question

Here is my chartboost Mainactivity.java class code

   // 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();
}

I also include chartboost.jar in my libs folder and also add dependencies in 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')
}

also add activity in androidManifest.xml ie

<activity android:name="com.chartboost.sdk.CBImpressionActivity"
        android:excludeFromRecents="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

But when I launch my add it just show force closed. Please help me. Thanx in advance.

Was it helpful?

Solution

I have solve the problem by making a separate class and extend that class in my MainActivity.java class and all other classes as well, and its work for me,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top