Android: questions about the re-creation of surfaceView ., Androidsurfaceview

Source: Internet
Author: User

Android: questions about the re-creation of surfaceView ., Androidsurfaceview

Recently, I was working on an Android Video Player project and encountered a problem: After the screen lock, surfaceview will be destroyed and various errors will occur. I posted a post on the csdn forum to ask questions. All the so-called gods said that the unlock screen was being re-created and asked him how to do it, so no response was returned. Later, I also tried to create it manually, but reported that surfaceview must be created before mediaPlayer.

In fact, you do not need to create a new one !!! After the screen is unlocked, surfaceview is automatically re-created. Therefore, you only need to restore the screen to its previous status after the screen is re-created.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.