1
我在onCreate()方法中使用了下面的一段代码......但是仍然显示了这两个消息,而transist从横向到protrait。请帮助我getrid它..android display orientation
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WindowManager wm=getWindowManager();
Display dis=wm.getDefaultDisplay();
if(dis.getWidth()>dis.getHeight())
Toast.makeText(getBaseContext(), "Landscape", Toast.LENGTH_SHORT).show();
else
Toast.makeText(getBaseContext(), "Portarit", Toast.LENGTH_SHORT).show();
}
你是否收到单向的两条消息? –
是的......我收到两个单向的消息。 – user636207