我在不同的方向上顯示兩種不同的佈局。方向改變時烤麪包不顯示爲什麼..?
在這兩個我都敬酒消息,方向改變。
它顯示在肖像烤麪包,但不在風景爲什麼..?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
System.out.println("Initial Oriatation is "+display.getOrientation());
int oriatation = display.getOrientation();
if(oriatation == 0){
Toast.makeText(getApplicationContext(), "Changed", Toast.LENGTH_SHORT)
.show();
createPort();
resumePort();
}else if(oriatation == 1){
Toast.makeText(getApplicationContext(), "Changed", Toast.LENGTH_SHORT)
.show();
createLand();
resumeLand();
}
}
在此先感謝...!
謝謝..... – Noby