Ejemplo n.º 1
0
 @SuppressWarnings("unchecked")
 @Override
 protected Void doInBackground(Integer... params) {
   // Primero intentamos cargar de caché
   league =
       (List<LeagueTeam>) Serializator.loadObject(getActivity(), Serializator.Type.LEAGUE_TEAM);
   if (params[1] == 0 || league == null) {
     publishProgress(new Void[0]);
     league = HTMLParser.league(params[0]);
     if (league != null) {
       Serializator.saveObject(
           getActivity().getApplicationContext(),
           (Serializable) league,
           Serializator.Type.LEAGUE_TEAM);
     }
   }
   return null;
 }
Ejemplo n.º 2
0
 @SuppressWarnings("unchecked")
 @Override
 protected Void doInBackground(Integer... params) {
   // Primero intentamos cargar de caché
   matches =
       (List<Match>) Serializator.loadObject(getActivity(), Serializator.Type.NEXT_MATCHES);
   if (params[1] == 0 || matches == null) {
     publishProgress(new Void[0]);
     int numMatches = 50;
     if (mainApp) {
       numMatches = 1;
     }
     matches = HTMLParser.matches(params[0], played, numMatches, null);
     if (matches != null) {
       Serializator.saveObject(
           getActivity(), (Serializable) matches, Serializator.Type.NEXT_MATCHES);
     }
   }
   return null;
 }