1Button button = (Button) rootView.findViewById(R.id.button1);
2button.setOnClickListener(new View.OnClickListener() {
3 @Override
4 public void onClick(View view) {
5 Intent intent = new Intent(getActivity(), AnotherActivity.class);
6 startActivity(intent);
7 }
8});