第一次分享自己开发中遇到的小趣味![]()
现在在做的项目有视频播放,自己第一次去看VideoView,使用中发现了有趣的地方。
videoView.setOnPreparedListener()和videoView.setOnCompletionListener()还有videoView.start()三个方法顺序问题
刚开始我的代码顺序为: OnCompletion();----->OnPrepared();--------->
start();
把OnPrepared()与OnCompletion()调换顺序 OnPrepared()方法直接报错;
后来我的顺序为:
start();------>
OnPrepared();--------->OnCompletion(); 完全没错;
想写出来让大家看看这个情况,顺序又改回去
: OnCompletion();----->OnPrepared();--------->start();
OnCompletion();方法直接报错;
把OnPrepared()与OnCompletion()调换顺序 完全没错;
不知道什么原因造成的。
![大哭](https://static-blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)