android display orientation
<p>I used the following piece of code in onCreate() method... But still it is displaying both messages while transists from landscape to protrait. Please help me to getrid of it..</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

     WindowManager wm=getWindowManager();
    Display dis=wm.getDefaultDisplay();

   if(dis.getWidth()&gt;dis.getHeight())
        Toast.makeText(getBaseContext(), "Landscape", Toast.LENGTH_SHORT).show();
    else
        Toast.makeText(getBaseContext(), "Portarit", Toast.LENGTH_SHORT).show();
 }
</code></pre>
