这是异步方法调用creatAccount
public static void multidata(Context context, ContactMaster cm) throws IOException, JSONException {
ContactMaster cm = db.findCRMContacts(regPhone);
final String CompanyName = cm.getCompanyName();
new createAccount(String CompanyName,Context context).execute();
}
这是使用参数使用doInBackground的createAccount的方法定义
private class createAccount extends AsyncTask<String, Context, String> {
protected String doInBackground(String companyName,Context context){
// api call to create account
}
}
尝试上面的代码-在方法调用时显示错误