title: Move to Next Activity on Button click
body: <p>I have 2 buttons in fragment and on button click, they displays Toast but I want move to another activity.</p>
  
  <p>Here's my code... </p>
  
  <pre><code>public class HomeFragment extends Fragment implements View.OnClickListener {
          Button btn,btn2;
  
          @Override
          public View onCreateView(LayoutInflater inflater, 
                                   ViewGroup container, 
                                   Bundle savedInstanceState)
          {
              View view = inflater.inflate(R.layout.fragment_home, 
                                           container, false);
              btn = (Button) view.findViewById(R.id.btn);
              btn2 = (Button) view.findViewById(R.id.btn2);
              btn.setOnClickListener(this);
              btn2.setOnClickListener(this);
              return view;
          }
  
          @Override
          public void onClick(View v) {
              switch (v.getId()){
                  case R.id.btn:
                      Toast.makeText(this.getActivity(),
                              "Button 1!", Toast.LENGTH_LONG).show();
  
                      break;
                  case R.id.btn2:
                      Toast.makeText(this.getActivity(),
                              "Button 2 !", Toast.LENGTH_LONG).show();
                      break;
              }
          }
      }
  </code></pre>