title: ListView savedInstanceState not working well
body: <p>I have a ListView and when I add items I save that with: </p>
  
  <pre><code>static ArrayList&lt;String&gt; notes = new ArrayList&lt;&gt;();
  ArrayAdapter&lt;String&gt; arrayAdapter;
  
  @Override
  protected void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      outState.putStringArrayList("notes", notes);
  }
  </code></pre>
  
  <p>and in the onCreate I get it with:</p>
  
  <pre><code>if (savedInstanceState == null) {
      notes.add("Test");
  } else {
      notes = savedInstanceState.getStringArrayList("notes");
  }
  
  arrayAdapter = new ArrayAdapter&lt;&gt;(this, R.layout.item, notes);
  listView().setAdapter(arrayAdapter);
  </code></pre>
  
  <p>The notes are saving and that is everything okay except the savedInstanceState is null and when I start the app over again it adds "Test" every time, where is my mistake?</p>