Add a textview in java


Ask A Question





Login To post a question

I have this code in the main activity:

if (T.ISHORIZONTAL) {
        // if(T.DISPLAY_WIDTH<480)
        adView = new AdView(this);
        adView.setAdSize(AdSize.SMART_BANNER);
        adView.setAdUnitId(getResources().getString(
                R.string.banner_ad_unit_id));
        // else
        // adView = new AdView(this, AdSize., "a150a0ece652e81");
        app = new App(context, null);
        FrameLayout layout = new FrameLayout(this);
        FrameLayout.LayoutParams gameParams = new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.FILL_PARENT,
                FrameLayout.LayoutParams.FILL_PARENT);
        adsParams = new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.WRAP_CONTENT,
                FrameLayout.LayoutParams.WRAP_CONTENT,
                android.view.Gravity.BOTTOM | android.view.Gravity.CENTER);
        if (T.DISPLAY_WIDTH < 380) {
            adsParams.setMargins(-70, 0, -70, 0);
        }
        layout.addView(app, gameParams);
        layout.addView(adView, adsParams);
        AdRequest adRequest = new AdRequest.Builder().build();
        adView.loadAd(adRequest);
        setContentView(layout);
    } else {

        setContentView(R.layout.main_lay);
        app = (App) findViewById(R.id.gameBoard1);
        adView = (AdView) findViewById(R.id.adView);

and this in the xml:

   <?xml version="1.0" encoding="utf-8"?>
   <RelativeLayout xmlns:ads="http://schemas.android.com/apk/res-auto"
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent" >

<com.is.cut.App
    android:id="@+id/gameBoard1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

<com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    ads:adSize="BANNER"
    ads:adUnitId="@string/banner_ad_unit_id" >
</com.google.android.gms.ads.AdView>

banner

My goal is to comply with the policies of Admob, is to separate the application from the banner using a textview, just as it is in the image, how could it be done? Thank you

For more info please click herehttps://stackoverflow.com/q/51270782



Have a question or need a custom quote?
info@smartinfocare.com