I came up with something that solves this issue, though I still don't really like the solution. Would welcome a more elegant approach if anyone knows of one.
What I did was use the mMedia SDK instead of AdMob. Their Interstitial and AdView classes can both take a Context rather than an Activity in the constructor. The Interstitial still didn't work out for me since it opens behind the Dream overlay. So what I ended up doing was adding an AdView to my Dream's XML layout, then setting its visibility to View.GONE until I wanted to display it. When it's time to display the ad I set it to View.VISIBLE.
The other issue I encountered was that after clicking the AdView it launches the browser with the ad's URL, which of course opens behind the Dream, defeating the purpose of showing an ad. So I ended up setting the Dream to be interactive, caught the onTouchEvent, then if the Ad is VISIBLE when the click happens call the Ad's callOnClick method. I also had to set the Ad's RequestListener to my Dream Service and implement the MMAdOverlayLaunched method, which is called when the Ad launches the browser. In this method I just called finish() to stop the Dream and let the browser display the Ad.
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
// Exit dream upon user touch
setInteractive(true);
// Hide system UI
setFullscreen(true);
// Set the dream layout
setContentView(R.layout.dream_layout);
//Initialize Ads
this.initAdvertising();
}
private void initAdvertising(){
MMSDK.initialize(this);
mDreamAd = (MMAdView) findViewById(R.id.adView);
//Separate thread will handle showing the ad
mDreamAd.setVisibility(View.GONE);
mAdRequest = new MMRequest();
//TODO add metadata to Request
mDreamAd.setMMRequest(mAdRequest);
mDreamAd.setListener(this);
mDreamAd.getAd();
}
@Override
public boolean dispatchTouchEvent(MotionEvent event){
super.dispatchTouchEvent(event);
if(mDreamAd != null && mDreamAd.isShown()){
mDreamAd.callOnClick();
}
return true;
}
@Override
public void MMAdOverlayLaunched(MMAd ad) {
//Finish so we can display the ad the user has clicked
if(ad.equals(this.mDreamAd))
this.finish();
}