application restarting when changing orientation even after locking in android
<p>I want to prevent my application from restarting when orientation of device changes. I have lock the app orientation as per below code but it doesn't help for the same.</p>

<pre><code>&lt;activity android:name=".CheckMemory"
    android:configChanges="orientation"
    android:screenOrientation="portrait"
    android:theme="@style/customTheme"
              android:label="@string/app_name"&gt;

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

<p>and </p>

<pre><code>@Override
    public void onConfigurationChanged(final Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    //Do nothing here
    }
</code></pre>
