title: Start new Activity from Dialog
body: <p>I try to open a new Activity after pressing OK Button but it doesn't work. Here is my code:</p>
  <pre><code>public class NameOfNewList extends AppCompatDialogFragment {
  
  Context mActivity;
  
  @NonNull
  @Override
  public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
      
      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      
      LayoutInflater layoutInflater = requireActivity().getLayoutInflater();
  
      mActivity = getContext();
  
      builder.setTitle(&quot;Nowa lista&quot;)
              .setView(layoutInflater.inflate(R.layout.activity_new_list_dialog, null))
              .setNegativeButton(&quot;Cancel&quot;, new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
  
                  }
              })
              .setPositiveButton(&quot;OK&quot;, new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      startNewList();
                  }
              });
  
      return builder.create();
  }
  
  public void startNewList() {
      Intent intent = new Intent(mActivity, NewList.class);
      startActivity(intent);
  }
  </code></pre>
  <p>}</p>
  <p>I've tried to find what is the problem but there was no answers to my question.</p>