title: Button onClick doesn't work
body: <p>I made a viewPager with three layouts on every page... And i want to deal with a button on second page, but somehow i cannot... (P.S.: without button codes, my viewPager works) I just simply try to change background when clicked...</p>
  
  <p>Here's my codes:</p>
  
  <pre><code>public class ViewPagerProjectActivity extends Activity implements OnClickListener{
  
  Button btn;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      ViewPagerAdapter adapter = new ViewPagerAdapter( this );
      ViewPager pager = (ViewPager)findViewById( R.id.viewpager );
      pager.setAdapter( adapter );
      pager.setCurrentItem(0);
  
  
  }
  
  
  public void OnClick(View v) {
      if(v.equals(btn)) {
      LinearLayout l = (LinearLayout) findViewById(R.id.deneme2);
              l.setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
      }       
  }    
  }
  </code></pre>
  
  <p>And Here's the error:</p>
  
  <pre><code>E/AndroidRuntime(273): FATAL EXCEPTION: main
  E/AndroidRuntime(273): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yahya.ViewPagerProject/com.yahya.ViewPagerProject.ViewPagerProjectActivity}: java.lang.ClassCastException: com.yahya.ViewPagerProject.ViewPagerProjectActivity
  E/AndroidRuntime(273):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  E/AndroidRuntime(273):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  E/AndroidRuntime(273):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  </code></pre>