If the button is inside the fragment then your class should look like
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
Button button = (Button)rootView.findViewById(R.id.button1);
button.setOnClickListener(mCorkyListener);
return rootView;
}
}
Otherwise you get the NullPointerException 'cause no view is found. Notice that the imageView member must be obtained properly as well.
Hope it helps.