大佬教程收集整理的这篇文章主要介绍了android – 在actionbarsherlock上方获取admob,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
谢谢.
我的总体布局:
<LinearLayout xmlns:android="http://scheR_543_11845@as.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <include layout="@layout/admob"/> <TabHost xmlns:android="http://scheR_543_11845@as.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout.....
我的adob布局:
<?xml version="1.0" encoding="utf-8"?> <com.google.ads.AdView xmlns:android="http://scheR_543_11845@as.android.com/apk/res/android" xmlns:ads="http://scheR_543_11845@as.android.com/apk/lib/com.google.ads" android:id="@+id/adView" android:layout_height="wrap_content" ads:adUnitId="123456" ads:adSize="BAnnER" android:layout_width="match_parent"/>
private ActionBarSherlock sherlock = ActionBarSherlock.wrap(this); @Override public void onCreate(Bundle savedInstanceStatE) { /* ... set up layout here ... */ adView = new AdView(this,AdSize.bAnnER,"deadbeefmeat"); ViewParent parentView = appView.getParent(); do { parentView = parentView.getParent(); } while(!(parentView instanceof LinearLayout)); ((LinearLayout)parentView).addView(adView,0); Adrequest adrequest = new Adrequest(); adrequest.addTestDevice(Adrequest.test_EMULATOR); adView.loadAd(adrequest); } // All setContentView methods are overridden because ActionBarSherlock has to modify the view @Override public void setContentView(int layoutResID) { // Don't call super! sherlock.setContentView(layoutResID); } @Override public void setContentView(View view) { // Don't call super! sherlock.setContentView(view); } @Override public void setContentView(View view,LayoutParams params) { // Don't call super! sherlock.setContentView(view,params); }
以上是大佬教程为你收集整理的android – 在actionbarsherlock上方获取admob全部内容,希望文章能够帮你解决android – 在actionbarsherlock上方获取admob所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。