title: Closing the application from a fragment causes returning to the parent activity
body: <p>I tried several ways to end application from inside of a fragment, like:</p>
  
  <pre><code>system.exit(1)
  android.os.Process.killProcess(android.os.Process.myPid());
  getActivity().finish();
  </code></pre>
  
  <p>and it is all of fragment code;Exit code put on exitDialog.setPositiveButton oncliklistener that in my try cuse backing to parent activity instead exit</p>
  
  <pre><code>package com.TB.mylistprojct;
  
  import android.os.Bundle;
  import android.app.AlertDialog;
  import android.app.Fragment;
  import android.content.DialogInterface;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.ViewGroup;
  import android.widget.Button;
  public class ActFooter extends Fragment
  {
      View            EMyView         =null;
  
      Button          BtnExit         =null;
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
  }
  
  @Override
  public View onCreateView(LayoutInflater Inflater,ViewGroup Container,Bundle SavedInstanceState)
  {
      View MyView=Inflater.inflate(R.layout.actfooter, Container,false);
      EMyView=MyView;
      InitialUI();
      return MyView;
  }
  
  public void InitialUI()
  {
      BtnExit=(Button)EMyView.findViewById(R.id.Btn_exit);
      BtnExit.setOnClickListener(BtnExit_OnClick);
  }
  
  public OnClickListener BtnExit_OnClick=new OnClickListener()
  {
  
      @Override
      public void onClick(View arg0)
      {
          AlertDialog.Builder exitDialog=new AlertDialog.Builder(getActivity());
  
          exitDialog.setTitle("Warning");
          exitDialog.setMessage("Exit Program");
          exitDialog.setPositiveButton("YSE", new DialogInterface.OnClickListener()
          {
              @Override
              public void onClick(DialogInterface arg0, int arg1)
              {
                  // Exit Code PUT Here
              }
          });
          exitDialog.setNegativeButton("NO", null);
          exitDialog.show();
      }
  };
  }
  </code></pre>
  
  <p>But the app returns to the parent activity</p>