android - Asynctask for cycle and substring -


i'm developing livescore app: i'm using asynctask in in doinbackground function download data web , elaborate them. in doinbackground there cycle, , inside there substring istruction. problem that, substring istruction cycle doesn't run cycles (makes 50 instead 100+ cycles). if remove substring istruction runs cycles perfectly. can me? (sorry bad english)

    protected string doinbackground(string... params) {         int i=0;         string casa=null;         string trasferta=null;         string ris=null;         string hinizio=null;            try {             document doc = jsoup.connect(urlind)                     .useragent("mozilla/5.0 (windows nt 6.2; wow64) applewebkit/537.22 (khtml, gecko) chrome/25.0.1364.172 safari/537.22")                     .timeout(60000).get();              elements partite = doc.select(....);             elements competizioni = doc.select(....);             string comp=competizioni.tostring();             string competizione=null;             if(objpartita.size()==0){                   (i=0;i<=partite.size();i++){                     //some jsoup query                     //objpartita.add(new partita....)                     competizione=estraicampionato(comp,trasferta); //estraicampionato function manipulate string (substring, indexof , conditions...)                  }               }else{                 //other jsoup query                 }              }               } catch (exception e) {             // gestione dell'eccezione             // ad esempio mostrare messaggio di errore o altro (qui nel logcat)             //log.e("esempio", "errore nel parsing");         }         return null;     } 

the problem if remove "estraicampionato" function, cycle completes cycles perfectly. contrarily, "estraicampionato" function runs part of cycle (for example 50 instead of 100+)


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -