Is there any way to force the portrait screen even the hard keyboard is popped?
<p>I specified an activity to be portrait-only in menifest file:</p>

<pre><code>&lt;activity android:name="mytest"
              android:alwaysRetainTaskState="true"
              android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
              android:screenOrientation="portrait"&gt;
</code></pre>

<p>But it won't work on Droid when its hard keyboard is popped out.</p>

<p>When hard keyboard is popped out, the device always renders the layout of the activity in landscape orientation first, then it switches it back to portrait orientation. How can I let the app only render the activity in portrait orientation?</p>

<p>Can anyone help? Thanks.</p>
