Coder Social home page Coder Social logo

Comments (16)

lecho avatar lecho commented on August 24, 2024

Hi, I'll check it. Can you tell me on which device you experienced this error?

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

Thanks lecho. You're so fast!
I experienced it on a Galaxy Note 3

from hellocharts-android.

lecho avatar lecho commented on August 24, 2024

Now it might take a while, I will try to reproduce it. One more question, do the error occurs when you rotate device or switching between activities?

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

It happends when i switch between activities.
My app is only in portrait mode.

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

But, in general, is there a function to call in onStop() or onDestroy() methods of fragments/activities when we use hellocharts to free some memory or anything else?

from hellocharts-android.

lecho avatar lecho commented on August 24, 2024

No, there is no method for that.

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

Lecho, I have a question concerning this problem.
I'll try to be understandable :-)
My app is using the 1.3 JAR version of hellocharts.
So, I gave a look at the source code of the Release of this 1.3 version at the line number 93 concerned by this problem in my error log :

"lecho.lib.hellocharts.renderer.LineChartRenderer.initDataMeasuremetns(LineChartRenderer.java:93)"

And I realized that in the 1.3 source, the line 93 don't correspond to this function (initDataMeasuremetns()) but it corresponds to the line of the 1.1 version of Release source code of this library...!

So it seems that the 1.3 JAR file of the hellocharts library (that i downloaded here at Release 1.3 Section : https://github.com/lecho/hellocharts-android/releases) has been generated with 1.1 source code...

Am I Right?

from hellocharts-android.

lecho avatar lecho commented on August 24, 2024

Hmm, I'm not sure but it looks like error log is correct, it points to line within initDataMeasurements() method when LineChartRenderer creates new bitmap
LineChartRenderer.java:93 at tag v1.3

For version 1.1 line 93 points to setting bitmap to canvas, that should not cause problems with memory.
LineChartRenderer.java:93 at tag v1.1

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

Yes, but on your first link ( LineChartRenderer.java:93 at tag v1.3 ) the corresponding manifest indicates 1.1 version.... not 1.3...

from hellocharts-android.

lecho avatar lecho commented on August 24, 2024

O, yes, looks like I forgot to change version number:/ But source code should be Ok.
I decompiled jar for version 1.3(in JD-GUI), it's ok, the same as for tag v1.3.

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

Ok thanks, so the problem is really due to createBitmap() function.

Just for information, in my Fragments, i add the chart programmatically (with addView) but not in XML UI file.

So, I add it in a Linear Layout which is defined in the XML file.

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

This problem appears on Samsung Galaxy s4, too

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

I replaced the backgrounds image (which had yet low resolution) of the fragments which contains charts by simple color backgrounds (no images but just color).
I have the impression that the problem has disappeared...
Maybe my background images filled too much memory (even if their resolutions were very low)....
So, it seems to be better...

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

I'll wait some hours before close this post, to be sure the problem is really solved

from hellocharts-android.

lecho avatar lecho commented on August 24, 2024

Ok, check with memory monitor if heap usage stays on the same level when you switch between activities.

from hellocharts-android.

sol4ris2048 avatar sol4ris2048 commented on August 24, 2024

Thanks a lot for your help and congratulations for your work on this lib.
Regards

from hellocharts-android.

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.