Initialized (Imageview) Error on Kindle Fire only....

DevBaby

Active Member
Licensed User
Longtime User
I have been able to successfully load and run my app on both a Samsung phone and the Kindle Fire. The same app with the exact same code via the BABridge.

With the Kindle, I get an "Object should be first initialized (ImageView)" error about 20% of the time.

The error occurs for the first panel screen loaded with an imageview (created in the designer). I load about 12 of these panels and the error occurs on the first panel, no matter the loading order. I am loading the panels in Activity_Create.

This also seems to occur after I hit the "BACK" Kindle button and then reload the app from the icon, again about 20% of the time.

Is their something I should put in the Activity_Pause section? I have tried Activity.Finish in an attempt to fully close out of the app.
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
I am using 6.2.2 on the fire and SDK API 8 for the builds. I have about five apps and each using imageviews and I have not see this issue.

Are you using LoadBitmapSample() to place your images? You may be running into memory limits and as you continue to load, the first panel is the oldest and may be that the OS is releasing it to free memory.

How large are the images? Are they bigger than the ImageView windows size?
 
Upvote 0

DevBaby

Active Member
Licensed User
Longtime User
Hi

Thanks for your response.

My images are small, less than 100 - 200KB each. There are about 10 images in total. I load the images in the designer. I tried loading the images in code and the whole app breaks (at the same loading point) and prompts me to force close...20% of the time.

My app is the only program loaded in the Kindle. I have a samsumg tranform that loads these same images fine every time. I believe that the KF would be able to hanlde more than the phone.

To replicate the error, I hit the back button and reload the app; 20% of the time, it fails.

The only other thing that I can think of is that the image views are all named "imageview1" in their respective layouts in the designer. Maybe KF doesn't like that. I will rename each imageview to a distinct name and see what happens. Other than the loading error, the app runs fine on the Kindle.

Thanks again for your help.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
It is not the size of the file on disk, but the size of the file loaded into memory. If your files are .jpg they are compressed and use a lot more memory when loaded. What is the pixel size of the images? 1024 x 600, etc.

Also, each time you exit your app, it is still in memory unless you used: ExitApplication which will terminate it. This is not recommended but you can add it to check things. You need to trap the backkey and force it to call the code ExitApplication and try your load and exit and see if your error goes away. If it does, it is most likely a memory issue.
 
Upvote 0
Top