Android Open Source - CallerFlashlight Ad Preference2






From Project

Back to project page CallerFlashlight.

License

The source code is released under:

GNU General Public License

If you think the Android project CallerFlashlight listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.spirosbond.callerflashlight;
/* ww  w. j  av a2s.c  om*/
import android.app.Activity;
import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

/**
 * Created by spiros on 12/31/13.
 */
public class AdPreference2 extends Preference {

  public AdPreference2(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);}

  public AdPreference2(Context context, AttributeSet attrs) {super(context, attrs);}

  public AdPreference2(Context context) {super(context);}

  @Override
  protected View onCreateView(ViewGroup parent) {
    // this will create the linear layout defined in ads_layout.xml
    View view = super.onCreateView(parent);

    // the context is a PreferenceActivity
    Activity activity = (Activity) getContext();

    // Create the adView
    AdView adView = new AdView(activity, AdSize.BANNER, "ca-app-pub-4450409123751393/8391059261");

    ((LinearLayout) view).addView(adView);

    // Load the adView with the ad request
    adView.loadAd(new AdRequest());


    return view;
  }
}




Java Source Code List

com.spirosbond.callerflashlight.About.java
com.spirosbond.callerflashlight.AdPreference2.java
com.spirosbond.callerflashlight.AdPreference.java
com.spirosbond.callerflashlight.AppList.java
com.spirosbond.callerflashlight.BatteryLevelReceiver.java
com.spirosbond.callerflashlight.BootReceiver.java
com.spirosbond.callerflashlight.CallPrefs.java
com.spirosbond.callerflashlight.CallReceiver.java
com.spirosbond.callerflashlight.CallerFlashlight.java
com.spirosbond.callerflashlight.CameraSurface.java
com.spirosbond.callerflashlight.Donate.java
com.spirosbond.callerflashlight.FirstTimeUtilisation.java
com.spirosbond.callerflashlight.Flash.java
com.spirosbond.callerflashlight.InteractiveArrayAdapter.java
com.spirosbond.callerflashlight.License.java
com.spirosbond.callerflashlight.MainPanel.java
com.spirosbond.callerflashlight.MediaButtonReceiver.java
com.spirosbond.callerflashlight.Model.java
com.spirosbond.callerflashlight.MsgPrefs.java
com.spirosbond.callerflashlight.NotificationService.java
com.spirosbond.callerflashlight.PrefsActivity.java
com.spirosbond.callerflashlight.SeekBarPreference.java
com.spirosbond.callerflashlight.SmsReceiver.java
com.spirosbond.callerflashlight.SortByCheck.java
com.spirosbond.callerflashlight.SortByString.java
com.spirosbond.callerflashlight.TimePreference.java