title: Attempt to invoke virtual method?
body: <p>I was trying to implement onClick listener in fragments.
  when i add </p>
  
  <pre><code>           button1.setOnClickListener (this)
  </code></pre>
  
  <p>is getting force close.</p>
  
  <p>Fragment code<br>
  <a href="http://pastebin.com/2Nk3fH80" rel="nofollow">Stack Trace</a></p>
  
  <pre><code>private  class PlaceholderFragment extends Fragment  implements OnClickListener{
       Button b1;
  private   PlaceholderFragment() {
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_main, container, false);
        b1  = (Button) container.findViewById(R.id.button1);
       b1.setOnClickListener(PlaceholderFragment.this);
  
          return rootView;
      }
  
      @Override
      public void onClick(View arg0) {
  
          // TODO Auto-generated method stub
  
      }
  }
  </code></pre>