版权声明:转载请注明出处 https://blog.csdn.net/menwaiqingshan/article/details/81078643
有一需求仿京东的语音识别页面。
https://github.com/Jay-Goo/WaveLineView
把这个波浪图形用在popupwindow上。
但是在用该控件的时候遇到了问题,就是第一次不会加载出现该波浪图形,百思不得其解。
一开始查出来startThread时renderThread为空。
renderThread初始化是在这里的。
扫描二维码关注公众号,回复:
5101401 查看本文章
所以原因就是renderThread没有初始化,surfaceCreated没有调用,为什么呢?
后来误打误撞给popupWindow设置了focus,发现正常了。
所以原因就是该控件没有获得焦点,然后sufaceCreated没有被调用。
surfaceView的知识https://blog.csdn.net/u014136472/article/details/47701659