I have detected some of my activities are blocked at the launch. So I wrote that code in a new project:
public class LayoutTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
long now = System.currentTimeMillis();
new AdView(this, AdSize.BANNER, "MY_ID");
Log.e("Admob Test","The UI was blocked "+(System.currentTimeMillis()-now)+"ms");
}
}
And the result is that the first creation of an AdView object blocks the UI thread for between 1 and 2 seconds.
Is there some way of avoiding that?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…