@ Yume177, tôi thấy làm thế nào để làm điều đó:
@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
RelativeLayout rl = (RelativeLayout) findViewById(R.id.about);
rl.removeAllViews();
rl.addView(View.inflate(myView.getContext(), R.layout.about, null));
}
tôi có 2 RelativeLayout cả tên "about.xml", với một bố trí trong một dir res/layout-sw720dp/about.xml với tôi có thể vẽ được cho chế độ dọc và res/layout-sw720dp-land/about.xml với cảnh quan có thể vẽ được. Khi tôi xoay máy tính bảng, bố cục của tôi phù hợp hoàn hảo. Hy vọng tôi sẽ giúp bạn
khi tôi thực hiện điều này, nó sẽ cho phép nhận dạng nullpointerexception? không có bất kỳ setcontentciew? –