Internship 24th: SurfaceView creates and destroyed places

After creation, the surfaceDestroy is only available when the activity is overwritten or destroyed.

The view sliding off the screen will not cause the surfaceView to be Destroy

In addition, if you put the surfaceView into the item in listVIew, and use the viewHolder mode,

Then the situation will be different again. There may be only a limited number of views created, which are the ones initialized.

If viewHolder is not used, surfaceVIEW will be based on The loading situation continues to be created

Therefore, you need to pay attention to a few things in surfaceCreated

In particular: If surfaceVIew has a playback event, you also need to pay special attention. MediaPlayer needs an output place,

It is the video screen output

If this surfaceVIew still has a surfaceVIEW that has not been destroyed, then the playback will be Will be affected

Leave a Comment

Your email address will not be published.