Giter Club home page Giter Club logo

Comments (3)

Leon406 avatar Leon406 commented on August 18, 2024

You can add version check as follow,and it will wrok well.

    if(  Build.VERSION.SDK_INT <21) {
      params.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
    }else if( Build.VERSION.SDK_INT <24) {
      params.type = WindowManager.LayoutParams.TYPE_TOAST;
    }else {
      params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
    }

from takt.

Fengcoder avatar Fengcoder commented on August 18, 2024

catch exception when loading tinker:java.lang.RuntimeException: Unable to create application com.tencent.radio.RadioApplication: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@8ca0794 has already been added
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@8ca0794 has already been added
at android.view.ViewRootImpl.setView(ViewRootImpl.java:691)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at jp.wasabeef.takt.Takt$Program.play(Takt.java:113)
at com.tencent.radio.RadioApplicationDelegate.initTakt(RadioApplicationDelegate.java:122)
at com.tencent.radio.RadioApplicationDelegate.onCreate(RadioApplicationDelegate.java:111)
at com.tencent.tinker.loader.app.TinkerApplication.onCreate(TinkerApplication.java:173)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
at android.app.ActivityThread.-wrap2(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

from takt.

Fengcoder avatar Fengcoder commented on August 18, 2024

7.1.1 直接crash了

from takt.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.