2012-04-24 8 views
0

ドキュメントを追加する方法を、私は私のコードにこのような何かを追加する必要が言う:がLeadBoltアプリの広告を追加する - のRunnable

// create a new layout 
LinearLayout layout = new LinearLayout(this); 
/* 
Add any elements to your view 
*/ 
// make the view visible 
this.setContentView(layout); 
final Activity act = this; 

// now add the banner or overlay to the app 

layout.post(new Runnable() { //what about this line? 
public void run() { 
myController = new AdController(act, MY_LB_SECTION_ID); 
myController.loadAd(); 
} 
}); 

私のレイアウトはXMLであると私はすでに私がlayout.post(new Runnable() { lineを意味setContentView(R.layout.config);を定義しています。コードをどのように変更すればよいですか?私は明白な解決策を見つけた興味を持っている人のため

+0

Noone?私はLeadBoltとは何の関係もないのですが、問題はランナブルを設定する方法ですか? – erdomester

答えて

0

は:

RelativeLayout rellaymain = (RelativeLayout)findViewById(R.id.rellaymain); 

     final Activity act = this; 
     rellaymain.post(new Runnable() { 

      public void run() { 
      myController = new AdController(act, MY_LB_SECTION_ID2); 
      myController.setAsynchTask(true); 
      myController.loadAd(); 
      } 
      //}); 
     }); 

rellaymainは.xmlファイルのレイアウトです。

関連する問題