i create an activity with fragment; then add an OnClickListener() for a button ;every thing work fine. but when i try to add an OnClickListener() for positivebutton to alertdialog eclipse give error before i can run program 
it's piece of code that have error and i do not now why :(

```
        AlertDialog.Builder exitDialog=new AlertDialog.Builder(getActivity());

        exitDialog.setTitle("Alert");
        exitDialog.setMessage("Exit Program");
        exitDialog.setPositiveButton("Yes", new OnClickListener()
        {

            @Override
            public void onClick(DialogInterface arg0, int arg1)
            {
                // TODO Auto-generated method stub
                System.exit(1);
            }
        });
        exitDialog.setNegativeButton("NO", null);
        exitDialog.show();

```

and it's whole code of my activity

```
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);
    InitialUI();
}

@Override
public View onCreateView(LayoutInflater Inflater,ViewGroup Container,Bundle SavedInstanceState)
{

    View MyView=Inflater.inflate(R.layout.actfooter, Container,false);
    EMyView=MyView;
    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)
    {
        // TODO Auto-generated method stub
        AlertDialog.Builder exitDialog=new AlertDialog.Builder(getActivity());

        exitDialog.setTitle("Alert");
        exitDialog.setMessage("Exit Program");
        exitDialog.setPositiveButton("Yes", new OnClickListener()
        {

            @Override
            public void onClick(DialogInterface arg0, int arg1)
            {
                System.exit(1);
            }
        });
        exitDialog.setNegativeButton("NO", null);
        exitDialog.show();

    }
};

}

```

anybody can help about this error