В маркете я увидел приложение, отображающее admob в диалоговом окне с предупреждением. после прочтения это и это и это ,
Я до сих пор не могу понять, как показывать рекламу в диалоговом окне с предупреждением, как показано ниже. (или любой другой метод, который может отображать рекламу в диалоговом окне с предупреждением)
Я чесал голову, пытаясь понять, как
сделать это.
Может ли кто-нибудь быть настолько любезным, чтобы помочь мне
пойти об этом?
XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@id/tablayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="*"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.xxx.xxx">
<TableRow>
<com.admob.android.ads.AdView android:id="@id/myad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#ff000000"
myapp:primaryTextColor="#ffffffff"
myapp:secondaryTextColor="#ffcccccc" />
</TableRow>
</TableLayout>
Java:
public void onBackPressed() {
//set up dialog
Dialog dialog = new Dialog(main.this);
dialog.setContentView(R.layout.exitdialog);
dialog.setTitle("This is my custom dialog box");
dialog.setCancelable(true);
//set up button
Button button = (Button) dialog.findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//now that the dialog is set up, it's time to show it
dialog.show();
}
});
}
Спасибо.