diff --git a/res/layout/article_fragment.xml b/res/layout/article_fragment.xml index a24db6c3..29334931 100644 --- a/res/layout/article_fragment.xml +++ b/res/layout/article_fragment.xml @@ -25,7 +25,7 @@ + ads:loadAdOnCreate="false" /> diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 7297daa1..46d530c2 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -16,6 +16,9 @@ import android.view.ViewGroup; import android.webkit.WebView; import android.widget.TextView; +import com.google.ads.AdRequest; +import com.google.ads.AdView; + public class ArticleFragment extends Fragment { @SuppressWarnings("unused") private final String TAG = this.getClass().getSimpleName(); @@ -90,6 +93,14 @@ public class ArticleFragment extends Fragment { if (cv != null) { cv.setVisibility(View.GONE); } + + AdView av = (AdView)view.findViewById(R.id.ad); + + if (av != null) { + AdRequest request = new AdRequest(); + request.addTestDevice(AdRequest.TEST_EMULATOR); + av.loadAd(request); + } } return view; diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 49b3db03..08971d59 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -1,6 +1,7 @@ package org.fox.ttrss; import java.util.HashMap; + import java.util.Timer; import java.util.TimerTask;