title: E/AndroidRuntime error with ImageButton
body: <p>I'm trying to handle 3 ImageButtons on my onClick function. but my application crashes and that's what I get on my logcat : </p>
  
  <pre><code>03-17 21:30:25.372: E/AndroidRuntime(17838):    at me.hicham.resume.HomeFragment.onCreate(HomeFragment.java:32)
  </code></pre>
  
  <p>it points to the line where i've set my ImageButton : </p>
  
  <pre><code>ImageButton fb_button = (ImageButton) getView().findViewById(R.id.button_facebook);
  </code></pre>
  
  <p>I don't see what might cause this problem (logcat error is not clear enough).</p>
  
  <p>here is my class :</p>
  
  <pre><code>package me.hicham.resume;
  
  import android.support.v4.app.Fragment;
  import android.content.Intent;
  import android.graphics.Typeface;
  import android.net.Uri;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.View.OnClickListener;
  import android.widget.ImageButton;
  import android.widget.TextView;
  import me.hicham.resume.R;
  
  
  public class HomeFragment extends Fragment implements OnClickListener {
  
  public HomeFragment(){}
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.fragment_home, container, false);
  
      ImageButton fb_button = (ImageButton) getView().findViewById(R.id.button_facebook);
      fb_button.setOnClickListener(this);
  
      ImageButton tw_button = (ImageButton) getView().findViewById(R.id.button_twitter);
      tw_button.setOnClickListener(this);
  
      ImageButton ln_button = (ImageButton) getView().findViewById(R.id.button_linkedin);
      ln_button.setOnClickListener(this);
      return rootView;
  }
  
  public void onViewCreated (View view, Bundle savedInstanceState){
      /*cool stuff in here*/
  
  }
  @Override
  public void onClick(View v) {
      Intent socialintent;
  
      if (v.getId()== R.id.button_facebook){
          socialintent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://"));
          this.startActivity(socialintent);
  
      }
      else if (v.getId()== R.id.button_twitter){
          socialintent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://"));
          this.startActivity(socialintent);
  
      }
      else if (v.getId()== R.id.button_linkedin){
          socialintent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://"));
          this.startActivity(socialintent);
  
      }       
  }
  
  
  }
  </code></pre>
  
  <p>Thanks for the help guys :)</p>