Friday, 15 April 2011

Asynctask read xml parallely in viewpager get crashed in android -



Asynctask read xml parallely in viewpager get crashed in android -

i utilize xml parser read asynctask parallel (multiple thread) in viewpager. here problem while swipe viewpager fastly app crashed. here code

private void dotheautorefresh(final int n) { final executorservice es = executors.newfixedthreadpool(7); //final countdownlatch latch = new countdownlatch(n); t=new thread(){ @override public void run() { this.setpriority(10); if(build.version.sdk_int >= build.version_codes.honeycomb){ load =new loadwebpageasync(n); load.executeonexecutor(asynctask.thread_pool_executor); }else{ load=new loadwebpageasync(n); load.execute();} } }; t.setpriority(10); es.execute(t); }

could please help me gets wrong. think problem update current fragment. new android please guide me right direction.

i not understand why creating thread pool , start single new thread. @ first sight seems not want phone call final executorservice es = executors.newfixedthreadpool(7); every time phone call dotheautorefresh

do start new thread in loadwebpageasync(n) ?

maybe can post error message , bit more code.

kind regards anton

android-fragments android-asynctask android-viewpager swipe

No comments:

Post a Comment