0

HI I am new to android application development.I know android:configChanges="orientation|screenSize" is used to avoid activity Restart but it does not allow UI(layout-port,layout-land) changes too.But What i want is,

I need to avoid activity restart when orientation changes and also take an effect of UI changes.(i.e) if the mobile in portrait the layout takes from layout-port (or) if the mobile in landscape the layout takes from layout-land

Is this possible to achive?If yes means reply soon. If any body know this Please help me. Thanks in advance

Stefan
  • 5,203
  • 8
  • 27
  • 51
sierra
  • 1
  • 2

1 Answers1

1

Try to call setContentView(R.layout.sample) again at onConfigurationChanged Method.

prijupaul
  • 2,076
  • 2
  • 15
  • 17
AK Ali
  • 152
  • 1
  • 6
  • I already tried Ali, But it does not allow user to interact with UI again – sierra Sep 24 '13 at 13:07
  • You have to write a common method to get all the resources using their ID's and call that method from onCreate and onConfigChange. – AK Ali Sep 24 '13 at 13:12
  • Ya Ali i did like that only..but no use for that..Is there any alternative way other than this alki...thanks for spending time for me ali – sierra Sep 24 '13 at 13:15
  • If you are doing like this only than user can interact with UI. May be you are doing something wrong please check your code once. – AK Ali Sep 24 '13 at 13:20