How to refresh an Android RelativeLayout when orientation changes without restarting the Activity?

Posted by johnrock on Stack Overflow See other posts from Stack Overflow or by johnrock
Published on 2010-06-07T04:19:19Z Indexed on 2010/06/07 4:22 UTC
Read the original article Hit count: 646

Filed under:

I have an Android Activity with a RelativeLayout and I have implemented the following method to prevent the activity from being recreated on change of Orientation:

@Override
public void onConfigurationChanged(Configuration newConfig) {       
    super.onConfigurationChanged(newConfig);

}

I am obviously not doing anything in this method, but it worked perfect when using a LinearLayout. Now however, using RelativeLayout, my layout is all messed up when changing to landscape orientation.

What is the most efficient way to have the screen redraw correctly without having the activity restarted again with a call to onCreate?

© Stack Overflow or respective owner

Related posts about android