Losing GridView once a rotate the device
<p>I am pretty new to android, and I am trying to implement a FragmentActivity, however things are not fully working, My activity layout is the following:</p>

<pre><code>&lt;RelativeLayout&gt;
 &lt;LinearLayout&gt;some buttons...&lt;/LinearLayout&gt;
 &lt;android.support.v4.view.ViewPager /&gt;
&lt;RelativeLayout/&gt;
</code></pre>

<p>Also I have my fragment in another xml layout, as this:</p>



<pre><code>&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:horizontalSpacing="2dp"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth"
    android:verticalSpacing="2dp" &gt;

&lt;/GridView&gt;
</code></pre>

<p>My structure is, I have a paginator with a 'n' grids inside.</p>

<p><strong>The problem:</strong></p>

<p>Everything loads just fine, and I can paginate and all grids are just fine, however once I rotate my device, the grid disappear, and a new one fadein from page ONE. I have tried to keep the state of the page. but the main problem is that the GridView, should not disappear, and I dont know what i have to do to retain it.</p>

<p>Any clue?</p>

<p><strong>EDIT</strong>
This is how my Fragment Implementation look like:</p>

<pre><code>@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    final View v = inflater.inflate(R.layout.photo_grid_fragment,
            container, false);
    photoGrid = (GridView) v.findViewById(R.id.gridView);
    photoGrid.setAdapter(this.mAdapter);
    return v;
}
</code></pre>

<p>So I am holding the photoGrid in my fragment, buy still it disappears when i rotate my device.</p>
