Android Question Problem with error: Initialize (Imageview)

Levisvv

Member
Licensed User
Longtime User
I have an app that has a single activity and numerous different scrollview's that I show/hide depending on which list of menu items I want to show.
It works great on my Samsung Galaxy S5, but recently has started to just crash for no apparent reason "Unfortunatly HAPP has stopped working" which is an error that the debugger cannot catch??
Each Scrollview has alot of images (approx. 2 per row and 45+ rows per), could this be the reson for this crash?

Then I tried the same app on my older HTC OneS and I get a load of errors stating that the Imageview must be initialized first?

an anybody provide a hint as to what is causing this?

My best guess is that the phone can only handle so many view items (due to memory). Could this be the reason? SHoudl I switch to using multiple Activity's instead of multiple scrollviews?
 

Levisvv

Member
Licensed User
Longtime User
That crashing error does not show.
I no longer get the crash when I delete the most recently added layout, so I am thinking that it is a RAM/memory issue.

When running my app on my older HTC One S, most of the images will not display and it fully crashes after I rotate the screen.
I am convinced that my problems are related to memory.

would using different activities cause memory to be cleared/loaded in smaller chunks?
 
Upvote 0

Levisvv

Member
Licensed User
Longtime User
no I see now error, I posted my entire app here on filedropper to hopefully see if somebody can see why it now continually crashes on my Asus and HTC devices: http://www.filedropper.com/houle2tes
It runs well on my Galaxy S5, but still crashes once in a while (not often) but on my HTC devices it crashes right away and will not even start.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Not sure whether it is related or not however there is a bug in the code that handles the ini file.

I'm getting this error:

java.lang.RuntimeException: Object should first be initialized (Map).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:46)
at anywheresoftware.b4a.objects.streams.File.WriteMap(File.java:287)
at houle.ca.app.main._saveini(main.java:3595)
at houle.ca.app.main._loadini(main.java:2049)
at houle.ca.app.main._activity_create(main.java:630)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at houle.ca.app.main.afterFirstLayout(main.java:98)
at houle.ca.app.main.access$100(main.java:16)
at houle.ca.app.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Object should first be initialized (Map).
** Activity (main) Resume **

It happens because you are trying to save an uninitialized map.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…