3
這是我加的廣告活動打開它時:應用程序崩潰使用AdMob,Android的
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Intent intent = new Intent(this, SelectArticle.class);
startActivity(intent);*/
// Create the adView
adView = new AdView(this, AdSize.BANNER, "a15172dfcf0c366");
// Lookup your LinearLayout assuming it's been given
// the attribute android:id="@+id/mainLayout"
TableLayoutlayout = (TableLayout)findViewById(R.layout.activity_main);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
setContentView(R.layout.activity_main);
}
在清單的結尾:
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</manifest>
我還加了jar文件googleAdmob。
當我打開應用程序它崩潰了。我應該添加什麼?