I'm trying to implement Admob banner in Custom Dialog box.
I want to make in in XML 'cause i'm thinking this is simplier to change it positions etc.
So here is fragment from my GameActivity where is Custom Dialog too.
Fragment with dialog:
public void showRestartDialog() {
final Dialog dialog = new Dialog(GameActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.activity_dialog);
//set up image view
ImageView img = (ImageView) dialog.findViewById(R.id.imageView1);
img.setImageResource(R.drawable.puste);
int highest = PrefUtil.getHighestScore(this);
String text = null;
if (currentPoint > highest) {
highest = currentPoint;
PrefUtil.setHighestScore(this, currentPoint);
} else {
}
text = "\n " + currentPoint + "\n\n " + highest;
TextView text1 = (TextView)
dialog.findViewById(R.id.TextView01);
text1.setText(text);
AdView adView = (AdView)dialog.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
Where is a problem? With this code, the dialog is showing but without banner. Help me please!
Greetings!