Question

I want to do something like in iPhone development: reposition controls manually without recreating the whole view. what are pros and cons of this approach?

Was it helpful?

Solution

Hopefully this will be useful for somebody.

if you don't want ro re-create your view on orientation change, the only thing you need is to change corresponding Activity in manifest file like this:

android:configChanges="keyboardHidden|orientation|keyboard"

if you want to reposition controls manually, override onConfigurationChanged and reposition everything you need there

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

    // reposition and/or hide/show controls here
} 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top