Code Monkey home page Code Monkey logo

resource_stream's Introduction

resource_stream

The android-iconify code used in this project can't load its embedded .ttf file using getResourceAsStream:

 Start com.yourcompany.resource_stream/.MainActivity
 --------- beginning of main
 --------- beginning of system
 E/com/yourcompany/resource_stream( 8122): Java exception raised: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference
 --------- beginning of crash
 E/AndroidRuntime( 8122): FATAL EXCEPTION: main
 E/AndroidRuntime( 8122): Process: com.yourcompany.resource_stream, PID: 8122
 E/AndroidRuntime( 8122): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yourcompany.resource_stream/com.yourcompany.resource_stream.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference
 E/AndroidRuntime( 8122):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
 E/AndroidRuntime( 8122):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
 E/AndroidRuntime( 8122):        at android.app.ActivityThread.access$800(ActivityThread.java:151)
 E/AndroidRuntime( 8122):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
 E/AndroidRuntime( 8122):        at android.os.Handler.dispatchMessage(Handler.java:102)
 E/AndroidRuntime( 8122):        at android.os.Looper.loop(Looper.java:135)
 E/AndroidRuntime( 8122):        at android.app.ActivityThread.main(ActivityThread.java:5254)
 E/AndroidRuntime( 8122):        at java.lang.reflect.Method.invoke(Native Method)
 E/AndroidRuntime( 8122):        at java.lang.reflect.Method.invoke(Method.java:372)
 E/AndroidRuntime( 8122):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
 E/AndroidRuntime( 8122):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
 E/AndroidRuntime( 8122): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference
 E/AndroidRuntime( 8122):        at com.joanzapata.android.iconify.Utils.resourceToFile(Utils.java:75)
 E/AndroidRuntime( 8122):        at com.joanzapata.android.iconify.Iconify.getTypeface(Iconify.java:80)
 E/AndroidRuntime( 8122):        at com.joanzapata.android.iconify.IconDrawable.<init>(IconDrawable.java:70)
 E/AndroidRuntime( 8122):        at com.yourcompany.resource_stream.MainActivity.onCreate(Native Method)
 E/AndroidRuntime( 8122):        at android.app.Activity.performCreate(Activity.java:5990)
 E/AndroidRuntime( 8122):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
 E/AndroidRuntime( 8122):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
 E/AndroidRuntime( 8122):        ... 10 more

resource_stream's People

Contributors

jjaffeux avatar

Watchers

 avatar  avatar  avatar

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.