这是我添加广告的活动:
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。
当我打开应用程序时,它崩溃了。我应该添加什么?