Comments (15)
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.
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.
same error
from htextview.
+1
from htextview.
+1
from htextview.
+1
from htextview.
+1 Any solution?
from htextview.
+1
from htextview.
+1
from htextview.
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.
fixed it
from htextview.
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.
@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.
+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.
+1 @hanks-zyh
from htextview.
Related Issues (20)
- Working bad with Fragments
- Code is not work as line gif
- ScaleTextView textSize can't be changed at runtime
- cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: HOT 1
- fix: OnResume getLineLeft crash HOT 1
- Problem with transparent background
- Does not work HOT 2
- can you give support to 64 bit
- Fatal Exception: java.lang.NullPointerException HOT 1
- Fatal Exception: java.lang.NullPointerException HOT 6
- Shaders are not working
- Does not work with non English text
- android.view.InflateException: HOT 1
- Attempt to invoke virtual method 'float android.text.Layout.getLineLeft(int)' on a null object reference HOT 1
- Can anyone gives me the template for running all of the animation?
- Can anyone gives me the template for running all of the animation? HOT 1
- .
- rainbow is not working
- Evaporate setText Color Not Working HOT 3
- Failed to resolve in gradle 9.0 and java 17 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htextview.