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);
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:visibility="visible" android:layout_width="match_parent" android:layout_height="match_parent">
<com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="ca-app-pub-2111998585475142/5214723513" > </com.google.android.gms.ads.AdView>
</LinearLayout>