Edited by:
It can help you
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject> { JSONObject jsonObjRecv; String result; @Override protected 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) {
Itβs clear here
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()>
You probably don't need to change the return values ββand parameters in the method declaration.
Just create the following line
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject>
methods will be created automatically according to the parameters and return types mentioned in
private class AddAsyncTask extends AsyncTask<String, Void, JSONOnject>
source share