Android Question Out Of Memory Error

Discussion in 'Android Questions' started by Big Dave, Mar 8, 2015.

  1. Big Dave

    Big Dave Member Licensed User


    I have successfully run an app on one tablet and am now in the process of porting it to a different tablet. I have encountered an out of memory error


    at Method)
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(
    at b4a.konn2.kon11._vvvvvvvvvvvvvvvvvvv7(
    at b4a.konn2.kon11._activity_create(
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(
    at anywheresoftware.b4a.BA.raiseEvent2(
    at b4a.konn2.kon11.afterFirstLayout(
    at b4a.konn2.kon11.access$100(
    at b4a.konn2.kon11$
    at android.os.Handler.handleCallback(
    at android.os.Handler.dispatchMessage(
    at android.os.Looper.loop(

    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(
    at dalvik.system.NativeStart.main(Native Method)

    No idea what has caused the problem but in my browsing the forum I have a couple of questions that may go some way to answer it

    1. In Activity_Create what sort of things should be in "If FIRSTTIME then...." coding. I have a number of mediaplayer and timer initialisations that are run every time Activity_Create is run.
    2. I have a mediaplayer load instruction that runs immediately before an ActivityStart and is used within that activity. This activity can be called many times during the course of running the app.

    Is it likely that my poor positioning of certain instructions causes them to use more and more memory leading to my out of memory errors.

    Thanks for looking.
  2. KZero

    KZero Active Member Licensed User

    it seems you are loading big or many bitmaps

    post the relevant code of how you load the bitmaps
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice