Android: How to run asynctask from different class file?

后端 未结 4 2014
醉酒成梦
醉酒成梦 2020-12-01 02:18

When I use my code in one class file, it runs perfectly:

package com.example.downloadfile;

import java.io.File;
import java.io.FileOutputStream;
import java         


        
4条回答
  •  無奈伤痛
    2020-12-01 02:58

    I know its too late to help you but for others this may help.

    Its so simple just Simply build an object of main class and than call the inner class like this

     OuterMainClass outer = new OuterMainClass();
           outer.new InnerAsyncClass(param)
             .execute();
    

    Thanks

提交回复
热议问题