use test mode ads on emulator
This commit is contained in:
parent
4ce2e67d59
commit
1d4c780f50
@ -25,7 +25,7 @@
|
||||
|
||||
<!-- Ad Placeholder -->
|
||||
<com.google.ads.AdView
|
||||
android:id="@+id/adView"
|
||||
android:id="@+id/ad"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center"
|
||||
android:background="@android:color/transparent"
|
||||
@ -33,6 +33,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
ads:adUnitId="a14ed24fe8c671c"
|
||||
ads:adSize="BANNER"
|
||||
ads:loadAdOnCreate="true" />
|
||||
ads:loadAdOnCreate="false" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.fox.ttrss;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user