You should make all of your findViewById
calls on rootView
.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_home, container, false);
ImageButton fb_button = (ImageButton) rootView.findViewById(R.id.button_facebook);
fb_button.setOnClickListener(this);
ImageButton tw_button = (ImageButton) rootView.findViewById(R.id.button_twitter);
tw_button.setOnClickListener(this);
ImageButton ln_button = (ImageButton) rootView.findViewById(R.id.button_linkedin);
ln_button.setOnClickListener(this);
return rootView;
}