title: Fragment inner class should be static
body: <p>I have a <code>FragmentActivity</code> class with inner class that should display <code>Dialog</code>. But I am required to make it <code>static</code>. Eclipse offers me to suppress error with <code>@SuppressLint("ValidFragment")</code>. Is it bad style if I do it and what are the possible consequences?</p>
  
  <pre><code>public class CarActivity extends FragmentActivity {
  //Code
    @SuppressLint("ValidFragment")
    public class NetworkConnectionError extends DialogFragment {
      private String message;
      private AsyncTask task;
      private String taskMessage;
      @Override
      public void setArguments(Bundle args) {
        super.setArguments(args);
        message = args.getString("message");
      }
      public void setTask(CarActivity.CarInfo task, String msg) {
        this.task = task;
        this.taskMessage = msg;
      }
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the Builder class for convenient dialog construction
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setMessage(message).setPositiveButton("Go back", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int id) {
            Intent i = new Intent(getActivity().getBaseContext(), MainScreen.class);
            startActivity(i);
          }
        });
        builder.setNegativeButton("Retry", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int id) {
            startDownload();
          }
        });
        // Create the AlertDialog object and return it
        return builder.create();
      }
    }
  </code></pre>
  
  <p><code>startDownload()</code> starts Asynctask.</p>