1

我在运行时创建了一个线程。每个线程都从soap 获取文件。我一次下载多个文件。但线程超过 350 kb 的文件无法下载。如何解决这个问题呢?我是android的初学者。

4

1 回答 1

1
use **intent service** dear it will always running while your process is not completed 



public class MyIntentService extends IntentService {







    public MyIntentService() {
        super("com.example.androidintentservice.MyIntentService");
    }

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();

    }

    @Override
    protected void onHandleIntent(Intent intent) {

        try {
                          DO YOUR TASK HERE 



            }



        } catch (Exception e) {
            e.printStackTrace();

        }

        // return result
        Intent intentResponse = new Intent();
        intentResponse.setAction(ACTION_MyIntentService);
        intentResponse.addCategory(Intent.CATEGORY_DEFAULT);
        intentResponse.putExtra(EXTRA_KEY_OUT, extraOut);
        sendBroadcast(intentResponse);
    }



}
于 2013-10-18T12:57:06.287 回答