Giter VIP home page Giter VIP logo

Comments (15)

kinsleykajiva avatar kinsleykajiva commented on May 24, 2024 5

clearly, this library can not be used in production, I would think it really needs more time to be fixed, several issues are still unresolved.

from htextview.

Sandrichka22 avatar Sandrichka22 commented on May 24, 2024 1

I also experienced the same error on version 0.1.0, 0.1.1 and 0.1.2 of the library. I am now going to see if 0.1.6 has the problem fixed...

from htextview.

Shoureken avatar Shoureken commented on May 24, 2024

same error

from htextview.

thiagovictorino avatar thiagovictorino commented on May 24, 2024

+1

from htextview.

danielsilver2 avatar danielsilver2 commented on May 24, 2024

+1

from htextview.

rhbarauna avatar rhbarauna commented on May 24, 2024

+1

from htextview.

joselusw avatar joselusw commented on May 24, 2024

+1 Any solution?

from htextview.

fillbirdpa avatar fillbirdpa commented on May 24, 2024

+1

from htextview.

iielse avatar iielse commented on May 24, 2024

+1

from htextview.

smasini avatar smasini commented on May 24, 2024

I have the same errore for the ScaleTextView and I resolve like this:

   ViewTreeObserver vto = scaleTextView.getViewTreeObserver();
    vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            scaleTextView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            scaleTextView.animateText("YOUR NIGHT LIFE PLANNER");
        }
    });

This is because android.text.Layout is null untill the view is ready.

from htextview.

hanks-zyh avatar hanks-zyh commented on May 24, 2024

fixed it

from htextview.

Miljan9602 avatar Miljan9602 commented on May 24, 2024

Still got this error.
E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'float android.text.Layout.getLineLeft(int)' on a null object reference

from htextview.

tanish2k09 avatar tanish2k09 commented on May 24, 2024

@hanks-zyh Umm... This is marked closed but I'm still getting this error.

Using version 0.1.6 right now.
So I'm reading the cpufreq continuously (at 1500ms intervals) using a thread and then update a HTextview (scale) on the main (UI) thread using a runnable and posting it using a handler with Looper.getmainlooper(). The runnable has the animateText call in it.

The thread is run from within a fragment. So I stop the thread onStop of the fragment to stop extra resource consumption by the thread and I restart the thread onResume of the fragment. Now if I turn off my screen, it calls onStop (and I have confirmed it is called) which stops the thread but when I turn the screen back on again, onResume is called and I restart the thread and that's when the crash happens and dumps the following log :

java.lang.NullPointerException: Attempt to invoke virtual method 'float android.text.Layout.getLineLeft(int)' on a null object reference at com.hanks.htextview.scale.ScaleText.drawFrame(ScaleText.java:98) at com.hanks.htextview.base.HText.onDraw(HText.java:114) at com.hanks.htextview.scale.ScaleTextView.onDraw(ScaleTextView.java:44) at android.view.View.draw(View.java:17209) at android.view.View.updateDisplayListIfDirty(View.java:16191) at android.view.View.draw(View.java:16975) at android.view.ViewGroup.drawChild(ViewGroup.java:3727) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513) at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1966) at android.view.View.updateDisplayListIfDirty(View.java:16186)

I have tried using a simple android textview instead of HTextview and it works fine. And also from looking at the log I'm confident there's nothing wrong with my own logic implementations. Looks like an internal issue with the HTextview so I dropped this post here.

Edit 1 :
I noticed a weird thing. If I turn off and then turn on my screen, the app crashes with the above log.
But, if I switch to some other app first, like opening settings from the notifications area, the app doesn't crash in bg, and it also resumes fine after picking it from recents. Lockscreen is causing an issue.

If you need some more things like some code parts from my app or stuff like that I will happily provide it for fixing this issue.

from htextview.

alejouribesanchez avatar alejouribesanchez commented on May 24, 2024

+1

E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'float android.text.Layout.getLineLeft(int)' on a null object reference
at com.hanks.htextview.evaporate.EvaporateText$3.run(EvaporateText.java:65)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)

from htextview.

janvalji avatar janvalji commented on May 24, 2024

+1 @hanks-zyh

from htextview.

Related Issues (20)

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.