I'm using the master/detail flow of android and I'm trying to detect the screen orientation in order to make the master part smaller in portrait mode but I'm having some difficulties, I wrote this method :
@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
setContentView(R.layout.activity_analyse_list);
LinearLayout layout = (LinearLayout) findViewById(R.id.mastermenu);
layout.setLayoutParams(new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, (float) 0.5));
}
}
And i put it in the ListActivity
which is the first and main activity but nothing happen when I flip the tablet, I tried to use Log.d
to see if the onConfigurationChanged
is called on the rotation but nothing on the logcat.