How would i return an ArrayList of objects and a String from one aSyncTask class.
The aSyncTask uses jsoup to retrieve 3 elements of a table which is put into a new Employee class and then returned back to MainActivity as an arraylist but i want it to also return a String for that specific table.
MainActivity
public void onButtonClick()
new GetEmployee() {
@Override
protected void onPostExecute(ArrayList<Employee> list) {
Intent intent = new Intent(getApplicationContext(), EmployeeActivity.class);
intent.putParcelableArrayListExtra("empClass", list);
//i want to also pass the title of the Employee table aswell as the list,
//after running the aSyncTask
startActivity(intent);
}
}.execute();
GetEmployee
public Employee empObj;
@Override
protected ArrayList<Employee> doInBackground(String... params)
{
ArrayList<Employee> emp = new ArrayList<Employee>();
String title;
try {
//get employee details from table using JSoup
//get employee table title using JSoup
empObj = new Emp(...);
emp.add(empObj);
return emp;
} catch (IOException e) {
e.printStackTrace();
}
return emp;
How would i return a String from here as well as an ArrayList of Employee