//global
private AsyncTask<String,String,String> myAsync;
//inside my activity
public class Myreceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
String arg[] = {intent.getStringExtra("id")};
myAsync= new AsyncTask<String, String, String>(); //error here
myAsync.execute(arg);
}
}
错误是:
无法实例化类型 AsyncTask
为什么 ?