title: Changing a RecyclerView's Layout upon orientation change only works on the first view
body: <p>In my application i have this code to calculate phone size and change <code>RecyclerView</code> layout manager to <code>GridLayoutManager</code> or <code>LinearLayoutManager</code></p>
  
  <pre><code>private void changeFeedsLayout() {
      // Choose between one, two or three elements per row
      if (dpWidth &gt; 720 &amp;&amp; getResources().getConfiguration().orientation ==
              ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
          instagram_feeds.setLayoutManager(new GridLayoutManager(
                  context, 3, LinearLayoutManager.VERTICAL, false));
      } else if (dpWidth &gt; 520) {
          instagram_feeds.setLayoutManager(new GridLayoutManager(
                  context, 2, LinearLayoutManager.VERTICAL, false));
      } else {
          instagram_feeds.setLayoutManager(new LinearLayoutManager(
                  context, LinearLayoutManager.VERTICAL, false));
      }
  }
  </code></pre>
  
  <p>this code work fine when i attach or commit each fragment to container on <code>MainActivity</code> , but it doesn't work when in change phone orientation, for fix this problem i'm using this code:</p>
  
  <pre><code>@Override
  public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
      changeFeedsLayout();
  }
  </code></pre>
  
  <p>and unfortunately layoutmanager of <code>RecyclerView</code> is <code>LinearLayoutManager</code> always and i can't resolve that. after switch on other fragment and back to previous fragment work fine.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>on change phone orientation this code as:</p>
  
  <pre><code>instagram_feeds.setLayoutManager(new LinearLayoutManager(
                      context, LinearLayoutManager.VERTICAL, false));
  </code></pre>
  
  <p>don't work on phone change orientation  on <code>changeFeedsLayout()</code> method and this method couldn't calculate correctly phone size on change phone orientation</p>