문제

Say in portrait mode i made my screen divided into 2x1 matrix (2 VideoViews), so that two videos can be played simultaneously.

                                   -------------------
                                   |                 | 
                                   |                 |
                                   |      VV1        |
                                   |                 |
                                   -------------------
                                   |                 | 
                                   |                 |
                                   |      VV2        |
                                   |                 |
                                   -------------------

Now, when i rotate the mobile to landscape, the screen will need to get divided into 2x2 matrix(4 VideoViews).

                        ----------------------------------------------
                        |                     |                      |
                        |                     |                      |                                                        
                        |        VV1          |         VV2          |
                        |                     |                      |  
                        ----------------------------------------------
                        |                     |                      |
                        |                     |                      |                                                        
                        |        VV3          |         VV4          |
                        |                     |                      |  
                        ----------------------------------------------

So, in this case, when changing from portrait to landscape, i want below points needs to be achieved.

  1. Neeeds to change the layout dynamically without any interruption in the videos.(From 2 Videoview to 4 Videoview).

  2. The Video should play flawlessly. Should not do pause and play during orientation.

  3. If you ppl advise me to use "configChanges="orientation"", how can i handle the layout during orientation???

Thanks in advance

도움이 되었습니까?

해결책

Using Fragments might be a solution. It does retain its state on orientation changes if you choose (so you won't lose instance objects), but also it recreates the layout, so you would be able to change current layout.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top