在使用WindowManager.addView时报错:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
这个问题和适配8.0有关,需要把WindowManager.LayoutParams的type设置为WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY