美文网首页
unable to add window -- token nu

unable to add window -- token nu

作者: CentForever | 来源:发表于2021-08-07 14:39 被阅读0次

    To avoid BadTokenException, you need to defer showing the popup until after all the lifecycle methods are called (-> activity window is displayed):

    findViewById(R.id.main_page_layout).post(new Runnable() {
       public void run() {
         pw.showAtLocation(findViewById(R.id.main_page_layout), Gravity.CENTER, 0, 0);
       }
    });
    

    相关文章

      网友评论

          本文标题:unable to add window -- token nu

          本文链接:https://www.haomeiwen.com/subject/dyxhmltx.html