Problems caused by different la s on the horizontal and vertical screens of android ActivityGroup

Source: Internet
Author: User

You need to write a page with the top unchanged and the following tabs, the content displayed in the middle can be changed, and the ActivityGroup is used for implementation. The jump between pages in the middle is implemented using the following statement: container. removeAllViews ();
Intent intent = new Intent (Player. this, PlayerAlbum. class );
Intent. addFlags (Intent. FLAG_ACTIVITY_CLEAR_TOP );
Window subActivity = (ActivityGroup) GinwavePlayer. this. getParent (). getLocalActivityManager (). startActivity ("", intent );

Container. addView (subActivity. getDecorView ());,

Because different la s need to be displayed on the horizontal and vertical screens (the content displayed on the horizontal screen is a Gallery for Image Browsing), You can reset the layout in the onConfigurationChanged function, when the portrait screen is displayed, the page Jump is normal, from the portrait screen to the landscape screen, and then to the portrait screen, the page cannot jump over (from Player to PlayerAlbum page ), after logging, I found that the PlayerAlbum constructor has been executed, but the Player page is still displayed. I asked a question on csdn and no one gave an answer, maybe I asked too late. I thought about why the jump was normal during the Portrait last night, but it changed from the portrait screen to the landscape screen, the jump cannot be performed after the screen is changed to portrait. I think it may be because the only String ID is not specified for the above startActivity. Then I add a unique String ID to it, but there is still a problem, then I think it may be because the Activity record in ActivityGroup is incorrect, and I added it before subActivity (ActivityGro Up) PlayList. this. getParent (). getLocalActivityManager (). removeAllActivities () function, and then the switchover is normal. The understanding of ActivityGroup is still problematic. Let's take a look at it later ~~


From the column xiaoxiaobian3310903

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.