Android Question listview and resume

drgottjr

Expert
Licensed User
Longtime User
i have a lengthy listview - 2 lines&bitmap (icon/50x50) - from which the user selects videos to stream.
initially, the listview takes a couple seconds to load the list from disk, load the bitmaps, set itself up and
display. not an eternity, but long enough to make the user think the app is not responding. once built,
visibility can instantly be toggled on/off, which is what one would expect. however, when i decided to
introduce a screen orientation change (to watch the videos in landscape mode), the listview does not
survive the change and has to be rebuilt over and over... (from a design point of view, scrolling the listview in landscape looks terrible, and watching the videos in portrait is not as nice as watching in landscape, so i have what i have.)

in an attempt to mitigate the lost time constantly rebuilding the view, i moved the list of videos to process globals. i also dim'd an array of bitmaps in process globals (assuming that the actual loading of the bitmaps might survive the resume.) since i still experience the lag, i'm assuming either what i want can't be done or i'm going about it in the wrong way.

would it make a difference if the actual viewing of the videos were a separate activity or intent? or is the main activity torn down regardless? in other words, the main activity would be limited to portrait, and the video activity would run in landscape. to my mind, technically, that would not be an orientation change. i'm more accustomed to forking and exec'ing, so "intents" and "activities" do not come naturally to me. i'm not sure exploring these makes sense in this case. can someone advise? thanks.
-go
 

drgottjr

Expert
Licensed User
Longtime User
thanks. your comment: "if you correctly hold the bitmaps as process globals" prompted me to take another look to make sure. the bitmaps were stored ok, but a process global flag kept resetting itself at the wrong time and forcing the images to reload. that has been corrected, and the listview works like a charm on the orientation change. thanks again.
go
 
Upvote 0
Top