• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help activity with viewpager and fragments does not resume the potrait layout when rotating the device. O

LFinocchio

Lurker
Jun 1, 2016
1
0
Introduction

I'am facing a strange problem that is happening only on the new device I am trying: Huawei P8.

I can't put a screenshot of what is happening but I will try to summarize as follow:

  • The activity has only one layout in folder "layout"
  • Some of the fragments that compose the viewpager have both "layout" and "layout-land" layouts for different views depending on the rotation of the device.
Problem
  • Starting the activity in potrait everything works and the fragments have their potrait layout

  • Rotating to landscape makes the fragments switch to their landscape layout (if the fragment has its custom landscape layout draws it) correctly

  • When rotating back to potrait the problem appears. The fragments that have a specific landscape layout does not switch back to potrait layout keeping the landscape one and the result is:

    With the device in potrait the layout is drawn with landscape layout (took from layout-land) which is very bad to see because every view is compressed/stretched unnaturally.
I have tried many smartphones in the years and this only happens on Huawei P8 (android 5.0)

Thanks
 
Sounds like an issue(bug) with the app and this particular device, especially given that it only happens on the Huawei. Probably worth emailing the developers, report it, or at least see if they can suggest anything.

Bare in mind Huawei is a Chinese phone, and these things usually run heavily modified, skinned and customized versions of Android. Huawei calls their's EMUI or "Emotion OS".
 
Last edited:
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones