title: How can I close the fragment?
body: <p>I am have Fragment on the Activity. Fragment has button. if i click on the button, Fragment must be close. How i am did this?</p>
  
  <pre><code>public class ItemFragment extends Fragment{
  
      private ImageView btnApply;
      private ClickButton clickButton = new ClickButton();
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.item_info, container, false);
          btnApply = (ImageView) rootView.findViewById(R.id.btnSendItem);
          btnApply.setOnClickListener(clickButton);
          return rootView;
      }
  
      private class ClickButton implements View.OnClickListener {
  
          @Override
          public void onClick(View v) {
              if (R.id.btnSendItem == v.getId()) {
                  Toast.makeText(getActivity(),"CLOSE",Toast.LENGTH_LONG).show();
                  return;
              }
          }
      }
  }
  </code></pre>