编辑:
这可以帮助您,
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject> { JSonObject jsonObjRecv; String result;@Overrideprotected JSonObject doInBackground(String... params) { AssetObj assetObj = new AssetObj(); assetObj.setAssetName(txtname.getText().toString()); assetObj.setMobileNo(txtmobile.getText().toString()); assetObj.setOwnerId(myApp.getOwnerId()); assetObj.setStartTime(startTime.getText().toString()); assetObj.setEndTime(endTime.getText().toString()); assetObj.setInterval(interval.getText().toString()); JSonObject jsonObjRecv = SyncService.AddNewAssetRequest(assetObj); } protected void onPostExecute(JSonObject obj){ if(obj != null) { //do something }很明显,
private class AddAsyncTask extends AsyncTask<What type of input you need to pass to doInBackground(), Void, What type of return value you need to return to onPostExcute()>
可能您不需要在方法声明中更改返回值和参数。
只需创建以下行
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject>
方法将根据您在中提到的参数和返回类型自动创建
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject>



