I have three activities in total and i am implementing admob for each activity, every activity has its own banner and when the activity is changes the other activity hangs a
The ideal way is to use fragments for each of your screens. This way, you'd use a single activity having a single adview.
If you want to use multiple activities instead, then the only workaround I know of is to use a static method to load the ads:
public class MyAdView {
public static void SetAD(AdView adView){
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
adView.loadAd(adRequest);
}
}
Usage:
public class SomeActivity extends Activity {
private AdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.caller_main);
MyAdView.SetAd((AdView)findViewById(R.id.adView));
}
}