【问题标题】:How to add startapp ad banner to android - cordova project?如何将 startapp 广告横幅添加到 android - cordova 项目?
【发布时间】:2014-07-16 14:03:00
【问题描述】:

这快把我逼疯了!我花了超过5天的时间。怎么了,为什么我的横幅没有显示?我遵循了来自:https://github.com/StartApp-SDK/Documentation/wiki/Android-InApp-&-InApp-Plus-Documentation

的所有说明

这是我的主要 java 文件:

package com.Snap.What;

import android.os.Bundle;
import org.apache.cordova.*;

import com.startapp.android.publish.StartAppAd;
import com.startapp.android.publish.StartAppSDK;

public class WhatSnap extends CordovaActivity 
{
    private StartAppAd startAppAd = new StartAppAd(this);
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        super.init();
        // Set by <content src="index.html" /> in config.xml
        super.loadUrl(Config.getStartUrl());
        //super.loadUrl("file:///android_asset/www/index.html");
        StartAppSDK.init(this, "******23", "*******04", true);
    }
}

这是我的布局:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 


<com.startapp.android.publish.banner.Banner 
          android:id="@+id/startAppBanner"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"/>


</LinearLayout>

横幅根本没有显示!

这是我进入应用时的logcat:

http://pastie.org/9396462

有人可以帮我添加这个简单的讨厌的横幅吗?

【问题讨论】:

    标签: android cordova webview cordova-3 startapp


    【解决方案1】:

    如集成手册中所述,对StartAppSDK.init() 的调用应 setContentView() 之前进行。
    你能改变你的代码,看看它是否有效?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-26
      • 1970-01-01
      相关资源
      最近更新 更多