Skip to content

Instantly share code, notes, and snippets.

@chetangiridhar
Created November 17, 2016 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chetangiridhar/b7d09ada3151ca09a07ffa7614365741 to your computer and use it in GitHub Desktop.
Save chetangiridhar/b7d09ada3151ca09a07ffa7614365741 to your computer and use it in GitHub Desktop.
Example of instantiating custom asynchronous task to make network calls
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Instantiate Async task
MyAsync myTask = new MyAsync(this);
//Run the task in an asynchronous way
myTask.execute("https://api.callhub.io/v2/conference/");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment