1. Download our Official Android App: Forums for Android!

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

Discussion in 'Android Apps & Games' started by LFinocchio, Jun 1, 2016.

  1. LFinocchio

    LFinocchio Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 1, 2016

    Jun 1, 2016
    1
    0
    5
    Male
    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
     

    Advertisement

  2. mikedt

    mikedt 你好
    Rank:
     #7
    Points:
    2,238
    Posts:
    24,200
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    24,200
    13,301
    2,238
    Teachaaa
    Jinan, China
    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".
     
    #2 mikedt, Jun 1, 2016
    Last edited: Jun 1, 2016

Share This Page

Loading...