title: Do intent based on which activity includes fragment
body: <p>Hello i have made a fragment which has one button and I am using it in two activities. The problem which arises from this is that the fragment will do the same intent</p>
  
  <p>Onclick(Type variable is which activity it should run and is not implemented into the onclick, this does not work):</p>
  
  <pre><code>runBtn.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
  if (type == 0){
          Intent sendToMain = new Intent(getActivity(), MainActivity.class);
          sendToMain.putExtra("newStory", story);
  
      }
      if (type ==1){
          Intent reviewStoryIntent = new Intent(getActivity(),storyReviewActivity.class);
          reviewStoryIntent.putExtra("Story", story);
      }
  
          }
      });
  </code></pre>
  
  <p>Is there any way to differentiate between which activity the fragment is placed in?</p>