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 la s 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 no unique string
ID is specified for the above startactivity. Then I add a unique string ID to it, There is a problem, and I think it may be because the activity record in activitygroup is wrong. Then I added (activitygroup) playlist. this. getparent ()). getlocalactivitymanager (). removeallactivities () function, and then the switch is no problem. The understanding of activitygroup is still problematic. Let's take a look at it later ~~

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: info-contact@alibabacloud.com 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.