dirkvranckaert / my-episodes-watch-manager

Automatically exported from code.google.com/p/my-episodes-watch-manager
1 stars 2 forks source link

Change the episode list view activity to only load episodes when list is empty #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When changing the phone's orientation the lists start to reload (also re-
download the episodes). When doing this very quickly I can sometimes still 
make the phone crash.

However it is not the intention to reload the data every time you just 
change the phones orientation (API sais that when changing the phones 
orientation the entire activity reloads).

Advantages:
1) Faster reaction time when changing the phones orientation
2) Less network usage

Example code in create method of the activity:
if (episodes.size() == null | episodes.size() == 0) {
   loadEpisodes();
} else {
   notifyDataSetChanged(episodes);
}
This way the list is always filled with the episodes already loaded but not 
refreshed!

Original issue reported on code.google.com by dirkvran...@gmail.com on 22 Jan 2010 at 7:57

GoogleCodeExporter commented 8 years ago

Original comment by dirkvran...@gmail.com on 21 Apr 2010 at 11:21

GoogleCodeExporter commented 8 years ago

Original comment by dirkvran...@gmail.com on 21 Apr 2010 at 9:39

GoogleCodeExporter commented 8 years ago
Need to find a proper solution.
The solution proposed in this issue does not work as switching orientation of 
the phone 
'relaunches' the current activity and so executes the onCreate of the activity 
again!

OnHold till found a better solution!

Original comment by dirkvran...@gmail.com on 21 Apr 2010 at 10:03