title: Implementing Leadbolt in Android app
body: <p>I am making my first Android app and I am trying to implement Leadbolt unlocker, I have done everything like Leadbolt documentation, but when I launch app it is always crashing. When I remove implement AdListener from <code>public class FullActivity extends Activity implements AdListener</code> then everything is working. App is crashing when <code>Intent full = new Intent(GridActivity.this, FullActivity.class);</code> and it is not even go to <code>super.onCreate(savedInstanceState);</code> breakpoint. 
  This is FullActivity.java:</p>
  
  <pre><code>import java.io.IOException;
  import android.app.Activity;
  import android.app.WallpaperManager;
  import android.content.SharedPreferences;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.widget.Toast;
  
  import com.Leadbolt.AdController;
  import com.Leadbolt.AdListener;
  
  public class FullActivity extends Activity implements AdListener{
  private AdController myController;
  private String MY_LB_SECTION_ID="1111111";
  
  private Integer[] mThumbIds = {
          R.drawable.p1, 
          R.drawable.p2,
          R.drawable.p3, 
          R.drawable.p4,
          R.drawable.p5, 
          R.drawable.p6,
          R.drawable.p7,
          R.drawable.p8,
          R.drawable.p9, 
          R.drawable.p10,
          R.drawable.p11, 
          R.drawable.p12,
          R.drawable.p13, 
          R.drawable.p14,
          R.drawable.p15,
          R.drawable.p16,
          R.drawable.p17, 
          R.drawable.p18,
          R.drawable.p19, 
          R.drawable.p20,
          R.drawable.p21, 
          R.drawable.p22,
          R.drawable.p23, 
          R.drawable.p24,
          R.drawable.p25, 
          R.drawable.p26,
          R.drawable.p27, 
          R.drawable.p28,
          R.drawable.p29,
          R.drawable.p30,
          R.drawable.p31, 
          R.drawable.p32,
          R.drawable.p33, 
          R.drawable.p34,
          R.drawable.p35, 
          R.drawable.p36,
          R.drawable.p37,
          R.drawable.p38,
          R.drawable.p39, 
          R.drawable.p40,
          R.drawable.p41, 
          R.drawable.p42,
          R.drawable.p43, 
          R.drawable.p44,
          R.drawable.p45,
          R.drawable.p46, 
          R.drawable.p47,
          R.drawable.p48, 
          R.drawable.p49,
          R.drawable.p50
  };
  
  Integer imageId;
  TouchImageView touch;
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      final Activity act = FullActivity.this; 
      final AdListener listener = FullActivity.this; 
      super.onCreate(savedInstanceState);
  
      Bundle extras = getIntent().getExtras(); 
      if (extras != null) {
          imageId = extras.getInt("image");
          touch = new TouchImageView(this);
          Bitmap snoop = BitmapFactory.decodeResource(getResources(), mThumbIds[imageId]);
          touch.setImageBitmap(snoop);
          touch.setMaxZoom(4f); //change the max level of zoom, default is 3f
          setContentView(touch);
      }
  
      final String PREFS_NAME = "AppPrefs";
  
      SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
      int ad = settings.getInt("ad", 0);
  
      if((imageId &gt; 25)&amp;&amp;(ad &lt; 1)){
  
          touch.post(new Runnable() { 
              public void run(){ 
                  myController = new AdController(act, MY_LB_SECTION_ID, 
                          listener); 
                  myController.loadAd(); 
              } 
          });
      }
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.main_menu, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle item selection
      switch (item.getItemId()) {
          case R.id.set_back:
              setBack();
              return true;
          default:
              return super.onOptionsItemSelected(item);
      }
  }
  
  private void setBack() {
      WallpaperManager myWallpaperManager 
      = WallpaperManager.getInstance(getApplicationContext());
      try {
              myWallpaperManager.setResource(mThumbIds[imageId]);
      } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
      }
      Toast.makeText(FullActivity.this.getApplicationContext(), "Wallapers set!", Toast.LENGTH_SHORT).show();
  }
  
  
  public void onDestroy(){ 
      myController.destroyAd(); 
      super.onDestroy(); 
  }
  
  public void onAdClicked() {}
  
  public void onAdClosed() {}
  
  public void onAdCompleted() {
      // TODO Auto-generated method stub
      SharedPreferences settings = getSharedPreferences("AppPrefs", 0);
      SharedPreferences.Editor editor = settings.edit();
      editor.putInt("ad", 1);
  
      // Commit the edits!
      editor.commit();
  }
  
  public void onAdFailed() {
      this.runOnUiThread(new Runnable() { 
          public void run() { 
              if(myController != null){ 
                  myController.destroyAd(); 
              } 
          } 
      });
  }
  
  public void onAdLoaded() {}
  
  public void onAdProgress() {}
  </code></pre>
  
  <p>}</p>