This piece of code has two activities where the first activity is in portrait mode and when we switch to second activity the orientation will change to landscape mode and it is done programmatically through java code.