Giter Site home page Giter Site logo

android_h264stream's People

Contributors

jwzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

android_h264stream's Issues

android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

Running on Android 6 and clicking on “Start Camera” button, i get this error:

11-04 12:34:09.254: E/AndroidRuntime(23968): java.lang.RuntimeException: Unable to create service tw.jwzhuang.ipcam.RecordService: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2887)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.app.ActivityThread.-wrap4(ActivityThread.java)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.os.Handler.dispatchMessage(Handler.java:102)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.os.Looper.loop(Looper.java:148)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.app.ActivityThread.main(ActivityThread.java:5417)
11-04 12:34:09.254: E/AndroidRuntime(23968): at java.lang.reflect.Method.invoke(Native Method)
11-04 12:34:09.254: E/AndroidRuntime(23968): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-04 12:34:09.254: E/AndroidRuntime(23968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-04 12:34:09.254: E/AndroidRuntime(23968): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.view.ViewRootImpl.setView(ViewRootImpl.java:571)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
11-04 12:34:09.254: E/AndroidRuntime(23968): at tw.jwzhuang.ipcam.RecordService.createView(RecordService.java:146)
11-04 12:34:09.254: E/AndroidRuntime(23968): at tw.jwzhuang.ipcam.RecordService.onCreate(RecordService.java:108)
11-04 12:34:09.254: E/AndroidRuntime(23968): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2877)
11-04 12:34:09.254: E/AndroidRuntime(23968): ... 8 more

I have tried to add this permission to Manifest (android.permission.SYSTEM_ALERT_WINDOW), but i still get the same error.
I think the problem is in RecordService.java creating the View using WindowManger.addView() function.

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.