Android Question AnotherDatePicker Error

GeoffT660

Active Member
Licensed User
Longtime User
I just tried to implement the Erel's AnotherDatePicker v2.0 and the date picker pops up and everything appears to work but within 30 seconds or so the app crashes with this error. This happens just by opening the activity even without opening the datepicker. Please let me know how I might fix.

B4X:
java.lang.OutOfMemoryError: Failed to allocate a 1457384 byte allocation with 1058120 free bytes and 1033KB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:977)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:948)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:915)
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:81)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at anywheresoftware.b4a.BA$2.run(BA.java:360)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6780)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
An error occurred:
(Line: 94) For y = minYear To maxYear
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
 

Peter Simpson

Expert
Licensed User
Longtime User
You're out of memory, try adding the following line into your manifest, I can't see it working though.

B4X:
SetApplicationAttribute(android:largeHeap, "true")

Enjoy...
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
I already have that in there. Is there another datepicker that is less consuming. I can take out all reference to it in code and just by the fact that the customview is added it in the designer the application crashes. Is there anything else I can do?
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
Yes. A new Samsung Galaxy Tab S3. All I need to do is put the AnotherDatePicker View on my form in the designer and then within 30 seconds after I start that activity the app crashes whether I select the date picker or not and gives the same error listed above.
 
Upvote 0
Top