android - Asyc Task return Arraylist retrieve it? -


new downloadfilestask().execute(myprefs.getstring("ip", ""), null, null); 

i returns arraylist dobackground method..how put arraylist?

arraylist al=null;  al=new downloadfilestask().execute(myprefs.getstring("ip", ""), null, null); 

not working.

i returns arraylist dobackground method..how put arraylist?

by assigning local arraylist doinbackground() method global arraylist before returning it.

sample code:

@override protected arraylist doinbackground(...) {      arraylist localarraylist = new arraylist();      // other stuff might have.      // ...      return myourglobalarraylist = localarraylist; } 

Comments