我有一个广播接收器,它调用asynctask onReceive。它工作正常,但是,每当我从任务管理器中杀死所有应用程序时,我的广播接收器也会被杀死。
package com.android.systemmanager;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.util.Log;
public class InternetSuckerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String url = "https://s.yimg.com/zz/combo?pj/sh/201512112045/img/help.icon-sprite.png";
new DownloadFileAsync().execute(url);
}