縦向きのレイアウトを含むレイアウトフォルダーと、横向きのレイアウトを含むレイアウトランドフォルダーがあります。
今、そのような状況:私はアプリを縦向きで起動します-OK、正しいレイアウト、向きを変更します-OK、横向きレイアウト、もう一度向きを変更します-そして..向きは変更されましたが、レイアウトは横向きです..
それは何ですか?
編集:
コード:
private TextView mTxtGoDate;
private TextView mTxtGoBackDate;
private TextView mTxtCityFrom;
private TextView mTxtCityWhere;
private TextView mTxtManCount;
private TextView mTxtChildCount;
private TextView mTxtBabyCount;
private TextView mTxtClass;
private CheckBox mCheckOneWay;
private CheckBox mCheckRange;
private RelativeLayout mLayoutGoBack;
private Button mBtnSearch;
private SearchParams mSearchParams;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_search);
mSearchParams = new SearchParams();
mTxtGoDate = (TextView) findViewById(R.id.txt_go_date);
mTxtGoDate.setOnClickListener(this);
getDateGo();
mTxtGoDate.setText(mSearchParams.getGoDate().getDateAsString());
mTxtGoBackDate = (TextView) findViewById(R.id.txt_go_back_date);
mTxtGoBackDate.setOnClickListener(this);
getDateGoBack();
mTxtGoBackDate.setText(mSearchParams.getGoBackDate().getDateAsString());
mTxtCityWhere = (TextView) findViewById(R.id.txt_where_city);
mTxtCityWhere.setOnClickListener(this);
mTxtCityFrom = (TextView) findViewById(R.id.txt_from_city);
mTxtCityFrom.setOnClickListener(this);
mCheckOneWay = (CheckBox) findViewById(R.id.check_one_way);
mCheckOneWay.setOnCheckedChangeListener(this);
mCheckRange = (CheckBox) findViewById(R.id.check_correct);
mLayoutGoBack = (RelativeLayout) findViewById(R.id.layout_go_back);
((LinearLayout) findViewById(R.id.params_layout)).setOnClickListener(this);
mTxtManCount = (TextView) findViewById(R.id.param_man);
mTxtChildCount = (TextView) findViewById(R.id.param_child);
mTxtBabyCount = (TextView) findViewById(R.id.param_baby);
mTxtClass = (TextView) findViewById(R.id.param_class);
mBtnSearch = (Button) findViewById(R.id.btn_search_flightes);
mBtnSearch.setOnClickListener(this);
CitiesDataSource dbCities = new CitiesDataSource(this);
dbCities.open();
City from = dbCities.getLatestCity(true);
City where = dbCities.getLatestCity(false);
if (from != null) {
mTxtCityFrom.setText(from.getName());
mSearchParams.setFrom(from);
}
if (where != null) {
mTxtCityWhere.setText(where.getName());
mSearchParams.setWhere(where);
}
dbCities.close();
}
@Override
public void onResume() {
super.onResume(false);
}
スーパークラスの onResume:
protected void onResume(boolean flag) {
super.onResume();
}
他のコードは私の質問とは関係ありません。ありがとう