I have been trying to create a simple app that POSTS to a PHP server. I would like to create a single class that can handle all post requests and then return data back to the original activity.
Presently I have a class called ConectionHandler which is designed to handle all of the Post requests.
public class ConnectionHandler extends AsyncTask<String, Void, String> {
public ConnectionHandler(ArrayList targetList, ArrayList dataList, String hostLocation){
...
}
protected String doInBackground(String... params){
...
return returnData;
}
I have been creating an object ConnectionHandler from my loginActivity. Once I receive the data in the doInBackground method I want it to go back to the loginActivity so that I can process it and start a new activity.
Is there any simple way to do this? I have experimented with many different ideas and none seem to work so far.
Any help would be great!
Aucun commentaire:
Enregistrer un commentaire